-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
49 lines (44 loc) · 1.7 KB
/
.pre-commit-config.yaml
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
# Configure pre-commit hooks to check for Python code validity, formatting and
# style issues and prompt for these to be corrected before committing.
repos:
# Use specific format-enforcing pre-commit hooks from the core library
# with the default configuration (see pre-commit.com for documentation)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-ast
- id: debug-statements
- id: end-of-file-fixer
types: [python]
- id: trailing-whitespace
types: [python]
# Also validate against 'black' for unambiguous Python formatting
# (see https://black.readthedocs.io/en/stable/ for documentation and see
# the cf-python pyproject.toml file for our custom black configuration)
- repo: https://github.com/ambv/black
rev: 24.4.2
hooks:
- id: black
language_version: python3
# Additionally validate againt flake8 for other Python style enforcement
# (see https://flake8.pycqa.org/en/latest/ for documentation and see
# the cf-python .flake8 file for our custom flake8 configuration)
- repo: https://github.com/PyCQA/flake8
rev: 7.1.0
hooks:
- id: flake8
# Apply the 'isort' tool to sort Python import statements systematically
# (see https://pycqa.github.io/isort/ for documentation). It is fully
# compatible with 'black' with the lines set to ensure so in the repo's
# pyproject.toml. Other than that and the below, no extra config is required.
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
- id: isort
name: isort (cython)
types: [cython]
- id: isort
name: isort (pyi)
types: [pyi]