- Remove `todo.md` as remaining items have been addressed or documented
elsewhere.
- Move note to `diff.md` that `pre-commit hazmat` subcommand (v4.5.0) is
not implemented.
Use `git for-each-ref --sort=-creatordate --format='%(refname:lstrip=2) %(creatordate:unix)' refs/tags` to get a list of tags along with their timestamps.
`creatordate` uses the tag’s creation time if it’s an annotated tag, and if it’s a lightweight tag, it falls back to the commit’s timestamp.
* feat: implement cooldown (default: 1 day)
* refactor: make update_repo a coordinator function
* fix: fallback to search all tags when candidate fails
* perf: batch the tag commit date iteration into one call
* Simplify logic
* Add tests
* Change `--cooldown-days` default to 0, keep backward compability
* Remove `cooldown_days` from config
---------
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
* fix(rust): find packages in virtual workspaces
* chore(deps): add cargo_metadata
* refactor: use cargo_metadata instead of DIY approach
* revert: do not change prek's own typos hook
* Sort deps
* Mention in `diff.md`
* Minor tweaks
---------
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
* Add Ruby support (no download support yet)
Currently only pre-existing Rubies are used, although the code will
search for and consider multiple versions. This allows a hook to require
3.4.7 when the default system Ruby is 3.4.6, but RVM (or a similar tool)
has installed 3.4.7. If a suitable Ruby cannot be found, the user is
prompted to install one manually and re-run.
Hooks get an isolated GEM_HOME, based on the hook repository, any
additional_dependencies, and the interpreter version/path. Any Ruby
upgrade would therefore re-install the gems to ensure that stale
versions aren't used. Repository gem dependencies are installed based on
the included gemspec files, combined with the additional_dependencies
field.
* Add pins for CI 'install Ruby' action
* Update setup-ruby pin
* Tweak version parsing
* Tweak env vars
---------
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
Checking the pre-commit documentation and the source code of prek will reveal that this is named language_version rather than language-version.
It's a tiny nit but a little confusing otherwise