-
Notifications
You must be signed in to change notification settings - Fork 5
/
.pre-commit-config.yaml
58 lines (52 loc) · 2.28 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
# Configure pre-commit hooks to check for Python code validity, formatting and
# style issues and prompt for these to be corrected before committing.
repos:
# Use specific format-enforcing pre-commit hooks from the core library
# with the default configuration (see pre-commit.com for documentation)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: check-ast
- id: debug-statements
- id: end-of-file-fixer
types: [python]
- id: trailing-whitespace
types: [python]
# Also validate against 'black' for unambiguous Python formatting
# (see https://black.readthedocs.io/en/stable/ for documentation and see
# the repo pyproject.toml file for our custom black configuration)
- repo: https://github.com/ambv/black
rev: 20.8b1
hooks:
- id: black
language_version: python3
# Also format docstrings in a consistent way, on top of 'black' requirements
# with the aim to auto-correct towards the Google docstring format (see
# https://google.github.io/styleguide/pyguide.html#381-docstrings) as much
# as possible (see https://github.com/myint/docformatter for docs, with
# configuration as below)
- repo: https://github.com/myint/docformatter
rev: v1.4
hooks:
- id: docformatter
# These arguments act as the configuration for docformatter. They:
# * make docformatter auto-format in-place if not compliant;
# * ensure there is a blank line after the final non-empty line;
# * wraps both summary and description at 72 characters (the latter
# by default).
args: [--in-place, --blank, --wrap-summaries=72]
# Check the docstrings conforms to Google docstring format as much as can
# be detected by the 'pydocstyle' checker
# (see http://www.pydocstyle.org/en/stable/index.html for
# docs and see the repo .pydocstyle.ini file for our custom configuration)
- repo: https://github.com/pycqa/pydocstyle
rev: 5.1.1
hooks:
- id: pydocstyle
# Additionally validate againt flake8 for other Python style enforcement
# (see https://flake8.pycqa.org/en/latest/ for documentation and see
# the repo .flake8 file for our custom flake8 configuration)
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
hooks:
- id: flake8