-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
59 lines (54 loc) · 1.43 KB
/
.pre-commit-config.yaml
File metadata and controls
59 lines (54 loc) · 1.43 KB
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
repos:
# Use pre-commit repo, v4.0.1
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.0.1"
hooks:
# Check for files that contain merge conflict strings.
- id: check-merge-conflict
stages: [ commit, push ]
# Trims trailing whitespace.
- id: trailing-whitespace
args: [ --markdown-linebreak-ext=md ]
stages: [ commit ]
# Checks that scripts with shebangs are executable.
- id: check-shebang-scripts-are-executable
stages: [ push ]
# Use locally installed hooks
- repo: local
hooks:
- id: autoflake
name: autoflake
# autoflake is cringe and does not respect .flake8 F401 ignores
entry: bash -c 'make autoflake_fix filename=$@' --
language: system
types: [ python ]
stages: [ commit ]
- id: black
name: black
entry: poetry
args:
- run
- black
language: system
types: [ python ]
stages: [ commit ]
- id: isort
name: isort
entry: poetry
args:
- run
- isort
- --filter-files
language: system
types: [ python ]
stages: [ commit ]
- id: flake8
name: flake8
entry: poetry
args:
- run
- flake8
language: system
always_run: true
pass_filenames: false
stages: [ push ]