-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
57 lines (51 loc) · 2.06 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
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
# ----- 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" ]
# ----- pydocstyle - ensure consistency of docstrings
- repo: https://github.com/pycqa/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
args:
- --ignore=D107,D203,D204,D213