-
SummaryI try to add linters in big project, and i dont want to fix all errors in 1000+ files. Step-by-step, each commit chould be fixed with linters Issue Type
Ansible and Ansible Lint details➜ ansible_linter_check git:(main) ansible --version
ansible 2.10.3
config file = None
configured module search path = ['/Users/user1/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/Cellar/ansible/2.10.4/libexec/lib/python3.9/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.9.1 (default, Dec 10 2020, 10:36:35) [Clang 12.0.0 (clang-1200.0.32.27)]
➜ ansible_linter_check git:(main) pre-commit --version
pre-commit 2.9.3
➜ ansible_linter_check git:(main) ansible-lint --version
ansible-lint 4.3.7
STEPS TO REPRODUCECreate 2 roles with errors, push first role with skip pre-commit, try to commit second and see errors from firsr Desired BehaviourLinter check only second role, only files in commit Actual BehaviourLinter check all files in repo (git ls-files) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Please use discussions if you have questions, not the issue tracker. The linter is a complex piece of software, not a simple code style checker and a modification made to one file may produce an error in another file that was not touched by last commit. Read the documentation about |
Beta Was this translation helpful? Give feedback.
-
I solve this by using this entry in pre-commit
This commit change policy, so i dont know best solution: https://github.com/ansible-community/ansible-lint/pull/932/files |
Beta Was this translation helpful? Give feedback.
I solve this by using this entry in pre-commit
This commit change policy, so i dont know best solution: https://github.com/ansible-community/ansible-lint/pull/932/files