Files
neutron-lib/.pre-commit-config.yaml
Stephen Finucane 46b4c63a38 pre-commit: Migrate pep8 target to pre-commit
This should be identical to what we had previously.

We also modify the various docs-related targets to minimise duplication,
clean up our test dependencies to remove those we don't use (plus
linters, which we don't use at runtime).

Change-Id: Iaf73bf225ee585fd6f6ea2e4cc838ccec59fc59a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-21 17:44:53 +01:00

65 lines
2.0 KiB
YAML

---
default_language_version:
# force all unspecified python hooks to run python3
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
args: ['--fix', 'lf']
exclude: '.*\.(svg)$'
- id: check-byte-order-marker
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: debug-statements
- repo: https://github.com/PyCQA/bandit
rev: 1.8.3
hooks:
- id: bandit
# B104: Possible binding to all interfaces
# B303: Blacklist use of insecure MD2, MD4, MD5, or SHA1 hash functions
# B311: Standard pseudo-random generators are not suitable for security/cryptographic purpose
args: ['-n5', '-sB104,B303,B311']
files: 'neutron_lib/'
exclude: 'neutron_lib/tests'
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: remove-tabs
exclude: '.*\.(svg)$'
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
hooks:
- id: mypy
pass_filenames: false
- repo: https://opendev.org/openstack/hacking
rev: 7.0.0
hooks:
- id: hacking
additional_dependencies:
- flake8-import-order~=0.18.2
- neutron
exclude: '^(doc|releasenotes|tools)/.*$'
- repo: local
hooks:
- id: check-unit-test-structure
name: check unit test structure
language: script
require_serial: true
pass_filenames: false
entry: './tools/check_unit_test_structure.sh'
files: '^.*\.py$'
exclude: '^(doc|releasenotes|tools)/.*$'
# TODO(slaweq): enable pylint check once all issues in the current code will
# be solved
# - id: pylint
# name: pylint
# entry: .tox/pep8/bin/pylint
# files: ^neutron_lib/
# language: system
# types: [python]
# args: ['--rcfile=.pylintrc', '--output-format=colorized']