-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
158 lines (141 loc) · 5.46 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# -*-mode:yml-*- vim:ft=yaml
# Config file for Pre-commit Git tool
#
# Insures base-line quality and consistency in all modified files when
# performing git commits.
# See:
# https://pre-commit.com/
# https://east.fm/posts/using-git-pre-commit-hooks/
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
- id: check-added-large-files
description: "Prevents giant files from being committed."
- id: check-ast
description: "checks whether the files parse as valid python."
- id: check-byte-order-marker
description: "Forbids files which have a UTF-8 byte-order marker."
- id: check-case-conflict
description: "Checks for files that would conflict in case-insensitive filesystems."
- id: check-docstring-first
description: "Checks a common error of defining a docstring after code."
- id: check-json
description: "Checks json files for parsable syntax."
- id: check-merge-conflict
description: "Check for files that contain merge conflict strings."
- id: check-toml
description: "Checks toml files for parsable syntax."
- id: check-yaml
description: "Checks yaml files for parsable syntax."
- id: debug-statements
description: "Check for debugger imports and py37+ `breakpoint()` calls in python source."
- id: end-of-file-fixer
description: "Ensures that a file is either empty, or ends with one newline."
- id: fix-encoding-pragma
description: "Adds # -*- coding: utf-8 -*- to the top of python files."
- id: mixed-line-ending
description: "Replaces or checks mixed line ending."
args: [--fix=lf]
- id: name-tests-test
description: "Verifies that test files are named correctly."
args: [--django]
- id: pretty-format-json
description: "Sets a standard for formatting JSON files."
- id: requirements-txt-fixer
description: "Sorts entries in requirements.txt."
- id: trailing-whitespace
description: "Trims trailing whitespace."
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
description: "Black: The uncompromising Python code formatter"
entry: black
language: python
language_version: python3
require_serial: true
types: [python]
- repo: https://github.com/asottile/blacken-docs
rev: v1.5.0
hooks:
- id: blacken-docs
description: "Runs `black` on python code blocks in documentation files."
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
hooks:
- id: flake8
description: "Enforces style consistency across Python projects."
- repo: https://github.com/asottile/seed-isort-config
rev: v1.9.4
hooks:
- id: seed-isort-config
description: "Populates the known_third_party isort setting."
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
- id: isort
description: "Sorts Python imports."
additional_dependencies: [toml]
exclude: ^(docs/conf\.py)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.761
hooks:
- id: mypy
args:
- --ignore-missing-imports
- repo: https://github.com/pre-commit/mirrors-pylint
rev: v2.4.4
hooks:
- id: pylint
description: "Checks for errors in Python code, tries to enforce a coding standard and looks for code smells."
args:
- --disable=E0401
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.1.0
hooks:
- id: python-safety-dependencies-check
description: "Analyzes your Python requirements for known security vulnerabilities."
- repo: https://github.com/PyCQA/bandit
rev: 1.6.0
hooks:
- id: bandit
description: "Finds common security issues in Python code."
exclude: ^(tests)/
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.5.1
hooks:
- id: python-check-blanket-noqa
description: "Enforces that `noqa` annotations always occur with specific codes."
- id: python-check-mock-methods
description: "Prevents a common mistake of `assert mck.not_called()` or `assert mck.called_once_with(...)`."
- id: python-no-eval
description: "Checks for the eval() built-in function."
- id: python-no-log-warn
description: "Checks for the deprecated `.warn()` method of python loggers."
- id: rst-backticks
description: "Detects common mistake of using single backticks when writing rst."
- id: text-unicode-replacement-char
description: "Forbids files which have a UTF-8 Unicode replacement character."
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 1.11.2
hooks:
- id: git-dirty
description: "Detects if git tree contains modified, staged, or untracked files."
- repo: https://github.com/pycqa/pydocstyle
rev: master
hooks:
- id: pydocstyle
description: "Checks compliance with Python docstring conventions."
- repo: https://github.com/mgedmin/check-manifest
rev: "0.40"
hooks:
- id: check-manifest
description: "Checks the completeness of MANIFEST.in."
- repo: https://github.com/Lucas-C/pre-commit-hooks-markup
rev: master
hooks:
- id: rst-linter
description: "Checks .rst files with the same linter used by pypi.org."
exclude: ^(docs)/