-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
53 lines (51 loc) · 2.24 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
# see https://pre-commit.com for more information
# see https://pre-commit.com/hooks.html for more hooks
# see https://www.python.org/dev/peps/pep-0008/ for PEP8 standard
# isort, black, flake8 for PEP8 https://rednafi.github.io/digressions/python/2020/04/06/python-precommit.html
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace # trims trailing whitespace
args: [--markdown-linebreak-ext=md]
types: [python]
- id: check-case-conflict # check for system dependent case conflicts
types: [python]
- id: check-yaml # check if YAML files can be compiled
- id: double-quote-string-fixer # change double quotes to single quotes
- id: end-of-file-fixer # add missing empty lines at EOF
exclude: 'docstring_coverage.svg' # must be ignored to prevent an endless loop of conflicting with each other
- id: check-ast # check whether files parse as valid python
types: [python]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
- id: python-use-type-annotations # https://florimond.dev/en/posts/2018/07/why-i-started-using-python-type-annotations-and-why-you-should-too/
types: [python]
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort
args: ["--line-length", "140"]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
types: [python]
- repo: https://github.com/econchick/interrogate
rev: 1.5.0
hooks:
- id: interrogate
# pass_filenames is false so that the config file can be found. Weird behaviour by interrogate
pass_filenames: false
# This line is for the CI, so it doesn't change the badge and fail the workflow run
args: [--config=pyproject.toml]
# Use this line instead if you want to update the badge locally
# args: [--config=pyproject.toml, --generate-badge=./badges/docstring_coverage.svg, --badge-style=flat]
- repo: https://github.com/rtts/djhtml
rev: 'v1.5.0' # replace with the latest tag on GitHub
hooks:
- id: djhtml
# Indent only HTML files in template directories
files: .*/templates/.*\.html$