-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
95 lines (86 loc) · 2.5 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
repos:
# Basic built in into pre-commit linters (validate json, xml, yaml and toml syntax, ensure no merge conflicts and no trailing whitespaces)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-added-large-files
stages: [commit]
- id: check-json
stages: [commit]
- id: check-xml
stages: [commit]
- id: check-yaml
stages: [commit]
args: [--unsafe]
- id: check-toml
stages: [commit]
- id: check-merge-conflict
stages: [commit]
- id: debug-statements
stages: [commit]
- id: detect-private-key
stages: [commit]
- id: name-tests-test
stages: [commit]
args: ['--django']
- id: no-commit-to-branch
stages: [commit]
- id: mixed-line-ending
stages: [commit]
- id: pretty-format-json
stages: [commit]
args: [--autofix, --indent=4]
- id: requirements-txt-fixer
stages: [commit]
- id: trailing-whitespace
stages: [commit]
args: [--markdown-linebreak-ext=md]
# Remove unused imports
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
stages: [commit]
args: ["--in-place", "--remove-all-unused-imports", '--ignore-init-module-imports', '--recursive']
# Autoformats python code to a single standard
- repo: https://github.com/psf/black
rev: 22.1.0
hooks:
- id: black
stages: [commit]
args: ["--line-length=99"]
# Groups and sorts python imports, see .isort.cfg for configuration
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
stages: [commit]
# Markdown linter, see markdownlint.yaml for configuration
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.31.1
hooks:
- id: markdownlint
stages: [commit]
args: ["--fix"]
- repo: local
hooks:
- id: pytest
name: pytest
entry: /opt/conda/bin/pytest
language: script
pass_filenames: false
always_run: true
# Push hooks (runs on push because developers may commit incomplete changes)
# Python files linter, see .pylintrc for configuration
- repo: https://github.com/PyCQA/pylint
rev: v2.12.2
hooks:
- id: pylint
stages: [push]
# Python security linter
- repo: https://github.com/PyCQA/bandit
rev: 1.7.2
hooks:
- id: bandit
stages: [push]
fail_fast: true