-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.pre-commit-config.yaml
56 lines (51 loc) · 3.22 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
hooks:
- id: check-yaml # Checks yaml files for parseable syntax
- id: check-json # Checks json files for parseable syntax
- id: check-toml # Checks toml files for parseable syntax
- id: check-executables-have-shebangs # Ensures that (non-binary) executables have a shebang
- id: check-case-conflict # Check for files that would conflict in case-insensitive filesystems
- id: check-added-large-files # Prevent giant files from being committed
- id: check-merge-conflict # Check for files that contain merge conflict strings
- id: check-symlinks # Checks for symlinks which do not point to anything
- id: pretty-format-json # Sets a standard for formatting JSON files
- id: debug-statements # Check for debugger imports and py37+ `breakpoint()` calls in python source
- id: detect-private-key # Detects the presence of private keys
- id: end-of-file-fixer # Ensures that a file is either empty, or ends with one newline
- id: fix-encoding-pragma # Add # -*- coding: utf-8 -*- to the top of python files
- id: forbid-new-submodules # Prevent addition of new git submodules
- id: mixed-line-ending # Replaces or checks mixed line ending
- id: name-tests-test # Verifies that test files are named correctly
- id: trailing-whitespace # Trims trailing whitespace
- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black # Python code formatter
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.5.1
hooks:
- id: python-check-blanket-noqa # Enforce that `noqa` annotations always occur with specific codes
- id: python-check-mock-methods # Prevent common mistakes of `assert mck.not_called()`, `assert mck.called_once_with(...)` and `mck.assert_called`
- id: python-no-eval # A quick check for the `eval()` built-in function
- id: python-no-log-warn # A quick check for the deprecated `.warn()` method of python loggers
- id: python-use-type-annotations # Enforce that python3.6+ type annotations are used instead of type comments
- repo: https://github.com/PyCQA/pylint
rev: pylint-2.5.0
hooks:
- id: pylint # a static code analysis tool for Python
args: [
--disable=E0401, # ignore missing imports issues
]
- repo: https://gitlab.com/PyCQA/flake8
rev: 3.8.3
hooks:
- id: flake8 # a command-line utility for enforcing style consistency across Python projects
- repo: https://github.com/doublify/pre-commit-isort
rev: v4.3.0
hooks:
- id: isort # Sort and organize Python imports
args: [ -m 2, -l 100 ]