neutron-lib/.pre-commit-config.yaml
Ihar Hrachyshka 1de9764ae9 Enable mypy pre-commit hook
Change-Id: I740bc58ae57e22c878b52215e72aaec6ebca1299
2025-01-09 18:20:40 -05:00

58 lines
1.7 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: v4.5.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-merge-conflict
- id: debug-statements
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
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.4
hooks:
- id: remove-tabs
exclude: '.*\.(svg)$'
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
hooks:
- id: mypy
args: [--config-file=./mypy.ini]
pass_filenames: false
- repo: local
hooks:
- id: flake8
name: flake8
additional_dependencies:
- hacking>=6.1.0,<6.2.0
- neutron
language: python
entry: flake8
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']