-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
93 lines (93 loc) · 2.89 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
93 lines (93 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
default_language_version:
# force all unspecified python hooks to run python3
python: python3
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
- id: check-yaml
files: .*\.(yaml|yml)$
# git
- id: check-added-large-files
- id: check-merge-conflict
- id: check-case-conflict
- id: detect-private-key
# python
- id: debug-statements
- id: check-docstring-first
exclude: 'neutron_lib/api/definitions/taas.py'
- repo: https://github.com/PyCQA/bandit
rev: 1.9.4
hooks:
- id: bandit
# B104: Possible binding to all interfaces
# B110: Try, Except, Pass detected
# 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,B110,B303,B311']
files: 'neutron_lib/'
exclude: 'neutron_lib/tests'
- repo: https://github.com/lucas-c/pre-commit-hooks
rev: v1.5.6
hooks:
- id: remove-tabs
exclude: '.*\.(svg)$'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.19
hooks:
- id: ruff-check
args: ['--fix', '--unsafe-fixes']
- 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: 8.1.0
hooks:
- id: hacking
additional_dependencies:
- flake8-import-order~=0.19.0
- neutron
exclude: '^(doc|releasenotes|tools)/.*$'
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v1.0.2
hooks:
- id: sphinx-lint
args: []
files: ^doc|releasenotes
types: [rst]
- 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']