-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
70 lines (60 loc) · 2.07 KB
/
.pre-commit-config.yaml
File metadata and controls
70 lines (60 loc) · 2.07 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
60
61
62
63
64
65
66
67
68
69
70
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# Configuration-wide default for the stages property of hooks.
default_stages: [commit, push]
exclude: "^static"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
# Identify invalid files
# check whether the files parse as valid python.
- id: check-ast
# checks yaml files for parseable syntax.
- id: check-yaml
# General quality checks
# trims trailing whitespace.
- id: trailing-whitespace
# replaces or checks mixed line ending
- id: mixed-line-ending
# ensures that a file is either empty, or ends with one newline.
- id: end-of-file-fixer
# Python checks
# check for debugger imports and py37+ `breakpoint()` calls in python source.
- id: debug-statements
# Git checks
# detects the presence of private keys
- id: detect-private-key
# check for files that would conflict in case-insensitive filesystems
- id: check-case-conflict
# check for files that contain merge conflict strings.
- id: check-merge-conflict
# prevent giant files from being committed
- id: check-added-large-files
# Removes unused imports and unused variables
- repo: https://github.com/myint/autoflake
rev: "v2.3.1"
hooks:
- id: autoflake
args:
[
"--in-place",
"--remove-all-unused-imports",
"--remove-unused-variables",
"--expand-star-imports",
"--remove-duplicate-keys",
"--ignore-init-module-imports",
]
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
# Uses max line length to 88 chars
args: ["--line-length=88"]
# Sort imports alphabetically, and automatically separated into sections and by type
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black", "--line-length=88"]
files: \.py$