|
| 1 | +repos: |
| 2 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 3 | + rev: v5.0.0 |
| 4 | + hooks: |
| 5 | + - id: check-merge-conflict |
| 6 | + - id: trailing-whitespace |
| 7 | + - id: end-of-file-fixer |
| 8 | + - id: check-added-large-files |
| 9 | + - id: detect-private-key |
| 10 | + - repo: https://github.com/PyCQA/flake8.git |
| 11 | + rev: 7.2.0 |
| 12 | + hooks: |
| 13 | + - id: flake8 |
| 14 | + - repo: https://github.com/adrienverge/yamllint.git |
| 15 | + rev: v1.37.1 |
| 16 | + hooks: |
| 17 | + - id: yamllint |
| 18 | + files: \.(yaml|yml)$ |
| 19 | + types: [file, yaml] |
| 20 | + entry: yamllint --strict -f parsable |
| 21 | + - repo: https://github.com/ansible/ansible-lint |
| 22 | + rev: v25.4.0 |
| 23 | + hooks: |
| 24 | + - id: ansible-lint |
| 25 | + always_run: true |
| 26 | + pass_filenames: false |
| 27 | + # do not add file filters here as ansible-lint does not give reliable |
| 28 | + # results when called with individual files. |
| 29 | + # https://github.com/ansible/ansible-lint/issues/611 |
| 30 | + # https://ansible-lint.readthedocs.io/en/latest/default_rules.html |
| 31 | + verbose: true |
| 32 | + # plugins is the standard collection dir for modules |
| 33 | + entry: env ANSIBLE_LIBRARY=plugins ansible-lint --force-color -p -v . |
| 34 | + additional_dependencies: |
| 35 | + - 'ansible>11,<12' |
| 36 | + - repo: https://github.com/openstack-dev/bashate.git |
| 37 | + rev: 2.1.1 |
| 38 | + hooks: |
| 39 | + - id: bashate |
| 40 | + # Run bashate check for all bash scripts |
| 41 | + # Ignores the following rules: |
| 42 | + # E003: Indends are not multiple of 4 |
| 43 | + # E006: Line longer than 79 columns (as many scripts use jinja |
| 44 | + # templating, this is very difficult) |
| 45 | + # E040: Syntax error determined using `bash -n` (as many scripts |
| 46 | + # use jinja templating, this will often fail and the syntax |
| 47 | + # error will be discovered in execution anyway) |
| 48 | + entry: bashate --error . --verbose --ignore=E006,E040,E003 |
0 commit comments