-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
84 lines (84 loc) · 2.38 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
84 lines (84 loc) · 2.38 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
---
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-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
- repo: https://github.com/lucas-c/pre-commit-hooks
rev: v1.5.6
hooks:
- id: remove-tabs
exclude: '.*\.(svg)$'
- repo: local
hooks:
- id: flake8
name: flake8
additional_dependencies:
- hacking>=6.3.0
- flake8-import-order>=0.19.0 # LGPLv3
language: python
entry: flake8
files: '^.*\.py$'
exclude: '^(doc|releasenotes|tools)/.*$'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.0
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.0.0
hooks:
- id: hacking
additional_dependencies: ['neutron-lib>=3.23.0']
exclude: '^(doc|releasenotes|tools)/.*$'
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v1.0.2
hooks:
- id: sphinx-lint
args: []
files: ^doc|releasenotes
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.1
hooks:
- id: mypy
pass_filenames: false
- repo: local
hooks:
- id: misc-sanity-checks
name: misc sanity checks
language: script
require_serial: true
pass_filenames: false
entry: './tools/misc-sanity-checks.sh'
files: '^.*\.py$'
exclude: '^(doc|releasenotes|tools)/.*$'