-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
73 lines (68 loc) · 2.41 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
repos:
# Quick content checks based on grepping for python specific patterns:
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
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: v4.0.1
hooks:
- id: check-added-large-files # Don't accidentally commit giant files.
args: ["--maxkb=10000"]
- 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.
# Make sure import statements are sorted uniformly.
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.9.3
hooks:
- id: isort
args: ["--profile", "black"]
# Format the code
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
language_version: python3.9
# Check for PEP8 non-compliance, code complexity, style, errors, etc:
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
args: [--max-line-length, "88"]
additional_dependencies:
- flake8-docstrings
- flake8-colors
- pydocstyle
- flake8-builtins
- mccabe
- naming
- pycodestyle
- pyflakes
- flake8-rst-docstrings
- flake8-use-fstring
# Check for known security vulnerabilities:
- repo: https://github.com/PyCQA/bandit
rev: 1.7.0
hooks:
- id: bandit
args: [--configfile, .bandit.yml]
# Unit tests
- repo: local
hooks:
- id: unit-tests
name: unit-tests
stages: [commit]
language: system
verbose: false
pass_filenames: false
always_run: true
entry: docker compose run --rm app pytest --doctest-modules dbcp test/unit --ignore input/