-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
118 lines (104 loc) · 3.99 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
minimum_pre_commit_version: 2.12.0
fail_fast: false
repos:
# Git-related
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0 # Use the ref you want to point at
hooks:
- id: forbid-new-submodules
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.5 # Use the ref you want to point at
hooks:
- id: git-dirty
# Reformatting (should generally come before any file format or other checks, because reformatting can change things)
- repo: https://github.com/sqlalchemyorg/zimports
rev: 0.3.0 # pick a hash or tag to point to
hooks:
- id: zimports
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0 # Use the ref you want to point at
hooks:
# black and docformatter don't do this in docstrings (11/1/19)
- id: trailing-whitespace
- id: pretty-format-json
args: [--autofix, --no-sort-keys]
# debatable whether this is necessary in Python3 or not
# https://stackoverflow.com/questions/14083111/should-i-use-encoding-declaration-in-python-3
- id: fix-encoding-pragma
- repo: https://github.com/psf/black
rev: 22.8.0 # pick a git hash / tag to point to
hooks:
- id: black
args: [--line-length=110]
- repo: https://github.com/myint/docformatter
# black seems to be working on formatting docstrings, but use this for now
rev: v1.4 # pick a git hash / tag to point to
hooks:
- id: docformatter
exclude: (tests*)|(exceptions\.py)|(warnings\.py)
# Safety/Security Issues
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.3.0
hooks:
- id: python-safety-dependencies-check
- repo: https://github.com/PyCQA/bandit
rev: 1.7.0
hooks:
- id: bandit
exclude: tests*
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0 # Use the ref you want to point at
hooks:
- id: detect-private-key
# Invalid File Checks
# - repo: https://github.com/pre-commit/pre-commit-hooks
# rev: v3.4.0 # Use the ref you want to point at
# hooks:
# - id: check-added-large-files
# name: forbid large files
# args: ['--maxkb=123']
# exclude: (tests/h5)|(tests/visual-regression-testing)|(docs/source/images)|(tests/zipped_windows_folder)
# - id: check-added-large-files
# name: forbid very large files inside tests/h5
# args: ['--maxkb=600']
# files: 'tests/h5'
# exclude: (tests/h5/peak_detection_errors)|(tests/h5/interpolation_error)
# - id: check-added-large-files
# name: forbid very large files inside tests/h5/peak_detection_errors and tests/h5/interpolation_error
# args: ['--maxkb=6000']
# files: 'tests/h5'
# - id: check-added-large-files
# name: forbid very large files for visual regression testing
# args: ['--maxkb=1000']
# files: 'tests/visual-regression-testing'
# - id: check-json
# - id: check-yaml
# - id: check-xml
# - id: debug-statements
# - id: check-merge-conflict
# - id: check-case-conflict
# - id: end-of-file-fixer
# Linting
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.981 # pick a git hash / tag to point to
hooks:
- id: mypy
- repo: https://github.com/Lucas-C/pre-commit-hooks-markup
rev: v1.0.1
hooks:
- id: rst-linter
exclude: docs
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.8.0 # pick a git hash / tag to point to
hooks:
- id: python-check-blanket-noqa
exclude: "curibio/__init__.py"
- id: python-check-mock-methods
- repo: https://github.com/PyCQA/flake8
rev: 3.9.0 # pick a git hash / tag to point to
hooks:
- id: flake8
- repo: https://github.com/NanoSurface-Biomedical/pre-commit-pylint
rev: "5a76725fa664ca733db485598da5c8460cf3347f" # pick a git hash / tag to point to
hooks:
- id: python-check-no-print-statments