repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- repo: https://github.com/mgechev/revive
#for start use dev tag, after development we switch to proper tags with versions
rev: dev-pre-commit
hooks:
- id: revive
in rev field for start we can set tag/branch but one condition is required file .pre-commit-hooks.yaml must exists i this tag/branch version otherwise command: pre-commit run --all-files (this command can be used to test configured hooks on our code without commit) will return error
pre-commit install
pre-commit installed at .git/hooks/pre-commit
steps to uninstall hooks in local repo:
pre-commit uninstall
pre-commit installed at .git/hooks/pre-commit
in development stage if we dont set rev field as v1.2.3 we can see warning like below:
[WARNING] The 'rev' field of repo 'https://github.com/mgechev/revive' appears to be a mutable reference (moving tag / branch). Mutable references are never updated after first install and are not supported. See https://pre-commit.com/#using-the-latest-version-for-a-repository for more details. Hint:pre-commit autoupdateoften fixes this.
Thank you @mfederowicz for providing a PR. I'll will close #913 without introducing the pre-commit hook definition in revive nor defining pre-commit config.
related with #913
basic .pre-commit-config.yaml:
in rev field for start we can set tag/branch but one condition is required file .pre-commit-hooks.yaml must exists i this tag/branch version otherwise command:
pre-commit run --all-files
(this command can be used to test configured hooks on our code without commit) will return error.pre-commit-hooks.yaml
hook presented above should be more configured, because it dumps some strage errors :
steps to install hooks in local repo:
steps to uninstall hooks in local repo:
in development stage if we dont set rev field as
v1.2.3
we can see warning like below:[WARNING] The 'rev' field of repo 'https://github.com/mgechev/revive' appears to be a mutable reference (moving tag / branch). Mutable references are never updated after first install and are not supported. See https://pre-commit.com/#using-the-latest-version-for-a-repository for more details. Hint:
pre-commit autoupdateoften fixes this.
steps to test code without commit: