-
Notifications
You must be signed in to change notification settings - Fork 2
/
.pre-commit-config.yaml
80 lines (72 loc) · 2.88 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
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
repos:
# exclude: ^vendor/
# ---- Pre-commit hooks ---- : Standard hook library
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace # strip out white spaces at end of lines
- id: end-of-file-fixer # ensure newline present at end of file
- id: check-yaml # checks yaml files for parseable syntax.
- id: check-json # checks json files for parseable syntax
- id: check-added-large-files # check for files above certain size (as likely to be data files)
args: ['--maxkb=500']
- id: detect-private-key # detects the presence of private keys.
- id: check-case-conflict # check for files that would conflict in case-insensitive file systems.
- id: check-merge-conflict # check for files that contain merge conflict strings.
# ----- Detect-secrets - Detects high entropy strings that are likely to be passwords.
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
exclude: .*/tests/.*|^\.cruft\.json$|.*ipynb # detect secrets flags interpreter hashes in the ipynb JSON files
# ----- nbstripout - remove content from notebooks
- repo: https://github.com/kynan/nbstripout
rev: 0.4.0
hooks:
- id: nbstripout
name: nbstripout - Strip outputs from notebooks (auto-fixes)
args:
- --extra-keys
- "metadata.colab metadata.kernelspec cell.metadata.colab cell.metadata.executionInfo cell.metadata.id cell.metadata.outputId"
# ----- black - code formatting
- repo: https://github.com/psf/black
rev: 22.3.0 # Replace by any tag/version: https://github.com/psf/black/tags
hooks:
- id: black
args: [--line-length=79]
additional_dependencies: ['click==8.1.0'] # here
name: black - consistent Python code formatting (auto-fixes)
language_version: python # Should be a command that runs python3.6+
# ----- flake8 - python linting
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
name: flake8 - Python linting
# ----- isort - imports sorting
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort - Sort Python imports (auto-fixes)
types: [ cython, pyi, python ]
args: [ "--profile", "black", "--filter-files" ]
# ----- nbQA - notebook quality assuring
- repo: https://github.com/nbQA-dev/nbQA
rev: 0.12.0
hooks:
- id: nbqa-isort
name: nbqa-isort - Sort Python imports (notebooks; auto-fixes)
args: [ --nbqa-mutate ]
additional_dependencies: [ isort==5.12.0 ]
- id: nbqa-black
name: nbqa-black - consistent Python code formatting (notebooks; auto-fixes)
args: [ --nbqa-mutate ]
additional_dependencies: [ black==22.3.0 ]
# ----- pydocstyle - ensure consistency of docstrings
- repo: https://github.com/pycqa/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
args:
- --ignore=D107,D203,D204,D213