Files
nova/.pre-commit-config.yaml
T
Stephen Finucane dc31f9fd61 Run mypy from tox
This avoids the need to duplicate our dependency list in multiple places
and allows us to take advantage of tox's dependency management
infrastructure, to ensure we always get the latest and greatest version
of a package allowed by upper-constraints. It also removes the slowest
pre-commit hook (by some distance), making pre-commit faster.

Change-Id: Ie241768231f180d5a672bf9f8fdc6a1eb8d7dfdb
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2026-01-20 18:03:04 +00:00

68 lines
1.9 KiB
YAML

---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
# whitespace
- id: trailing-whitespace
- id: mixed-line-ending
args: ['--fix', 'lf']
exclude: '.*\.(svg)$'
# file format and permissions
- id: fix-byte-order-marker
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-json
files: .*\.json$
- id: check-yaml
files: .*\.(yaml|yml)$
# git
- id: check-added-large-files
- id: check-merge-conflict
- id: check-case-conflict
- id: detect-private-key
exclude: '^doc/api_samples/.*|^nova/tests/.*'
# python
- id: debug-statements
# nova/cmd/manage.py imports pdb on purpose.
exclude: 'nova/cmd/manage.py'
- id: check-docstring-first
exclude: 'nova/virt/ironic/ironic_states.py'
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: remove-tabs
exclude: '.*\.(svg)$'
- repo: https://github.com/hhatto/autopep8
rev: v2.3.2
hooks:
- id: autopep8
files: '^.*\.py$'
# run hacking after autopep8 so that if it can fix
# it it will. note it will still fail in ci because
# fixing an issue changes the code and that should
# not happen in ci.
- repo: https://opendev.org/openstack/hacking
rev: 7.0.0
hooks:
- id: hacking
additional_dependencies: []
exclude: '^(doc|releasenotes|tools)/.*$'
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
args: ['--ignore-words=doc/dictionary.txt']
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v1.0.1
hooks:
- id: sphinx-lint
args: [--enable=default-role]
files: ^doc/|releasenotes|api-guide
types: [rst]