forked from catalyst-cooperative/pudl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
62 lines (55 loc) · 2.14 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
repos:
# Quick content checks based on grepping for python specific patterns:
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.4.1
hooks:
- id: python-check-blanket-noqa # Prohibit overly broad QA exclusions.
- id: python-no-eval # Never use eval() it's dangerous.
- id: python-no-log-warn # logger.warning(), not old .warn()
# Other file formatting, plus common Git mistakes & text file standardization:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-added-large-files # Don't accidentally commit giant files.
- id: check-merge-conflict # Watch for lingering merge markers.
- id: check-yaml # Validate all YAML files.
- id: check-case-conflict # Avoid case sensitivity in file names.
- id: debug-statements # Watch for lingering debugger calls.
- id: end-of-file-fixer # Ensure there's a newline at EOF.
- id: mixed-line-ending # Only newlines, no line-feeds.
- id: trailing-whitespace # Remove trailing whitespace.
- id: name-tests-test # Follow PyTest naming convention.
# - id: no-commit-to-branch # Only commit to master via merge.
# args: [--branch, master]
# Attempt to enforce standardized PEP8 style formatting:
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.4.4
hooks:
- id: autopep8
# Make sure import statements are sorted uniformly.
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
- id: isort
# Check for PEP8 non-compliance, code complexity, and syntax errors:
# Make sure the following plugins are installed as well:
# - flake8-docstrings
# - flake8-builtins
# - pep8-naming
- repo: https://github.com/PyCQA/flake8
rev: 3.7.8
hooks:
- id: flake8
args: [--format, "%(path)40s:%(row)-4d %(code)s %(text)s"]
# Check for errors in restructuredtext (.rst) files under the doc hierarchy
- repo: https://github.com/PyCQA/doc8
rev: 0.8.1rc1
hooks:
- id: doc8
args: [--ignore-path, docs/_build]
# Check for known security vulnerabilities:
- repo: https://github.com/PyCQA/bandit
rev: 1.6.2
hooks:
- id: bandit
args: [-c, .bandit.yml]