-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
127 lines (111 loc) · 3.4 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
119
120
121
122
123
124
125
126
127
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
#works
- repo: local
hooks:
- id: check-added-large-files
entry: pre-commits/check_added_large_files.py
name: Check for files larger than 5 MB
language: script
stages: [pre-commit]
args: [ "--maxkb=5120" ]
#works
- repo: local
hooks:
- id: end-of-line-fixer
entry: pre-commits/end_of_line_fixer.py
name: Check for a blank line at the end of scripts (auto-fixes)
language: script
stages: [pre-commit]
#works
- repo: local
hooks:
- id: trailing-whitespace
entry: pre-commits/remove_whitespace.py
name: Check for trailing whitespaces (auto-fixes)
language: script
stages: [pre-commit]
#works
- repo: local
hooks:
- id: mixed-line-endings
entry: pre-commits/mixed_line_endings.py
name: Check for consistent end of line type LF to CRLF to CR (auto-fixes)
language: script
stages: [pre-commit]
#works
#if using on different file types, it will need a seperate hook per file type
- repo: local
hooks:
- id: isort
entry: isort
name: isort - Sort Python imports (auto-fixes)
language: system
types: [python]
stages: [pre-commit]
args: [ "--profile", "black", "--filter-files" ]
#works
- repo: local
hooks:
- id: nbstripout
entry: nbstripout
name: nbstripout - Strip outputs from notebooks (auto-fixes)
language: system
stages: [pre-commit]
# args:
# - --extra-keys
# - "metadata.colab metadata.kernelspec cell.metadata.colab cell.metadata.executionInfo cell.metadata.id cell.metadata.outputId"
#works
- repo: local
hooks:
- id: black
entry: black
name: black - consistent Python code formatting (auto-fixes)
language: system
types: [python]
stages: [pre-commit]
args: ["--verbose"]
exclude: ^playground/
#works
- repo: local
hooks:
- id: flake8
entry: flake8
name: flake8 - Python linting
language: system
types: [python]
stages: [pre-commit]
# works in testing
- repo: local
hooks:
- id: detect-secrets
entry: detect-secrets-hook
name: detect-secrets - Detect secrets in staged code
args: [ "--baseline", ".secrets.baseline" ]
#args: [scan, audit]
language: system
types: [python]
stages: [pre-commit]
# - repo: local
# hooks:
# - id: nbqa-isort
# entry: nbqa-sort
# name: nbqa-isort - Sort Python imports (notebooks; auto-fixes)
# language: system
# types: [python]
# args: [ --nbqa-mutate ]
# additional_dependencies: [ isort==5.8.0 ]
# - repo: local
# hooks:
# - id: nbqa-black
# entry: nbqa-black
# name: nbqa-black - consistent Python code formatting (notebooks; auto-fixes)
# language: system
# types: [python]
# args: [ --nbqa-mutate ]
# additional_dependencies: [ black==21.5b2 ]
# TODO: Disabled for now until it's clear how to add noqa to specific cells of a Jupyter notebook
#- id: nbqa-flake8
# name: nbqa-flake8 - Python linting (notebooks)
# additional_dependencies: [ flake8==3.9.2 ]