tobiko/.pre-commit-config.yaml
Eduardo Olivares be35c2c8c7 Remove ansible-lint from tobiko
While tobiko master branch supports both python3.12 (needed for opendev
CI) and infrared (needed for downstream RHOSP CI), running ansible-lint
will not be possible due to the following incompatibility:
- in order to support python3.12, ansible-lint version v6.16.0 or greater
  needs to be used due to [1] and [2]
- with ansible-lint versions greater than v6, some of the errors raised
  are not compatible with ansible-core 2.9, which is the version used by
  infrared [3].

For example, fixing the following ansible-lint error would break
infrared support:
fqcn[action]: Use FQCN for module actions, such `ansible.posix.synchronize`.
infrared_plugin/roles/tobiko-ir-deploy/tasks/main.yaml:58 Action `synchronize` is not FQCN.

[1] https://github.com/ansible/ansible-lint/issues/2945
[2] https://github.com/ansible/ansible-lint/issues/3408
[3] 6c280e56c1/requirements.txt (L12)

Change-Id: I0ef09f2e3dced3401b4d41cb51c68e6dffd34798
2025-01-02 15:13:20 +01:00

64 lines
1.7 KiB
YAML

---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v3.4.0
hooks:
- id: check-added-large-files
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
args: [--allow-multiple-documents, --unsafe]
- id: detect-private-key
- id: end-of-file-fixer
- id: forbid-new-submodules
- id: requirements-txt-fixer
args:
- doc/requirements.txt
- extra-requirements.txt
- infrared_plugin/requirements.txt
- linters-requirements.txt
- requirements.txt
- test-requirements.txt
- upper-constraints.txt
- id: trailing-whitespace
- repo: https://github.com/pycqa/flake8.git
rev: '6.1.0' # pick a git hash / tag to point to
hooks:
- id: flake8
additional_dependencies: [flake8-import-order]
files: ^tobiko/
- repo: https://github.com/pre-commit/mirrors-mypy.git
rev: 'v0.981'
hooks:
- id: mypy
files: ^tobiko/
entry: mypy --install-types --non-interactive tobiko/
pass_filenames: false
# args: [--ignore-missing-imports]
- repo: local
hooks:
- id: pylint
name: pylint
entry: .tox/pep8/bin/pylint
files: ^tobiko/
language: system
types: [python]
# - repo: https://github.com/adrienverge/yamllint.git
# rev: v1.23.0
# hooks:
# - id: yamllint
# files: \.(yaml|yml)$
# - repo: https://opendev.org/openstack/bashate.git
# rev: 2.0.0
# hooks:
# - id: bashate