-
Notifications
You must be signed in to change notification settings - Fork 2
/
.pre-commit-config.yaml
51 lines (50 loc) · 2.42 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
---
# Test data is supposed to be verbatim, including errors. Exclude it from linting.
exclude: tests/integration/data
repos:
# Normalise all Python code. (Black + isort + pyupgrade + autoflake)
- repo: https://github.com/Zac-HD/shed
rev: 0.5.3
hooks:
- id: shed
- repo: https://github.com/PyCQA/flake8
# flake8 version should match .travis.yml
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies:
- dlint # Check common security issues
- flake8-broken-line # Don't escape newlines (surround in parens or simplify)
- flake8-bugbear # Lint-checks too opinionated for flake8 proper
- flake8-builtins # Don't allow built-in names like list
# - flake8-coding # Only UTF-8 # Couldn't fix C101 error
- flake8-debugger # Don't commit debugger calls
- flake8-executable # Check shebangs and executable permissions
- flake8-logging-format # Use log arguments, not string format
- flake8-pep3101 # Don't use old string % formatting
- flake8-pytest-style # Avoid common pytest mistakes
- flake8-pytest # Use plain assert, not unittest assertions
- flake8-rst-docstrings # docstring should be valid ReST
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-added-large-files # We don't want huge files. (Cut down test data!)
args: ['--maxkb=2000']
- id: check-case-conflict # Don't allow files that differ by case sensitivity.
- id: check-docstring-first # Avoid common error of code before docstring.
- id: check-json # Check json file syntax
- id: check-merge-conflict
- id: check-symlinks # Symlinks that don't point to anything?
- id: check-yaml # Check Yaml file syntax
- id: debug-statements # Avoid commiting debug/breakpoints
- id: fix-byte-order-marker # No UTF-8 byte order marks
- id: mixed-line-ending # Don't allow mixed line endings
- id: pretty-format-json
args: ['--no-sort-keys', '--indent=4', '--autofix']
- id: requirements-txt-fixer # Keep requirements files sorted.
- id: trailing-whitespace # Auto remove trailing whitespace
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.5
hooks:
- id: shellcheck
- id: shfmt