-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.pre-commit-config.yaml
155 lines (146 loc) · 5.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
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
---
minimum_pre_commit_version: 2.10.1
# default_language_version:
# python: python3.9
repos:
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
# pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
# Prevent giant files from being committed.
- id: check-added-large-files
# Simply check whether files parse as valid python.
- id: check-ast
# Require literal syntax when initializing empty or zero Python builtin
# types.
- id: check-builtin-literals
# Forbid files which have a UTF-8 byte-order marker
- id: check-byte-order-marker
# Check for files with names that would conflict on a case-insensitive
# filesystem like MacOS HFS+ or Windows FAT.
- id: check-case-conflict
# Checks for a common error of placing code before the docstring.
- id: check-docstring-first
# check-executables-have-shebangs
#- id: check-executables-have-shebangs
# Attempts to load all json files to verify syntax.
# - id: check-json
# Check for files that contain merge conflict strings.
- id: check-merge-conflict
# Checks for symlinks which do not point to anything.
# - id: check-symlinks
# Attempts to load all TOML files to verify syntax.
- id: check-toml
# Ensures that links to vcs websites are permalinks.
- id: check-vcs-permalinks
# Attempts to load all xml files to verify syntax.
# - id: check-xml
# Attempts to load all yaml files to verify syntax.
- id: check-yaml
# Check for debugger imports and breakpoint() calls in python source.
- id: debug-statements
# Detects symlinks which are changed to regular files with a content
- id: destroyed-symlinks
# Checks for the existence of AWS secrets, set up with the AWS CLI.
# - id: detect-aws-credentials
# Checks for the existence of private keys.
- id: detect-private-key
# This hook replaces double quoted strings with single quoted strings.
# - id: double-quote-string-fixer (KEEP DISABLED)
# Makes sure files end in a newline and only a newline.
- id: end-of-file-fixer
# Removes "# -*- coding: utf-8 -*-" on the top of python files.
- id: fix-encoding-pragma
args: [ "--remove" ]
# Sort the lines in specified files (defaults to alphabetical).
# - id: file-contents-sorter (KEEP DISABLED)
# Replaces or checks mixed line ending to LF.
- id: mixed-line-ending
args: [ "--fix=lf" ]
# Assert that files in tests/ match test*.py.
- id: name-tests-test
args: [ "--django" ]
# Protect specific branches from direct checkins.
- id: no-commit-to-branch
args:
- "-b master"
- "-p release/.*"
# Checks that all your JSON files are pretty.
# - id: pretty-format-json
# args: ["--autofix"]
# Sorts entries in requirements.txt and removes incorrect entry
# - id: requirements-txt-fixer (KEEP DISABLED)
# Sorts simple YAML files which consist only of top-level keys,
# preserving comments and blocks.
# - id: sort-simple-yaml (KEEP DISABLED)
# Trims trailing whitespace.
- id: trailing-whitespace
# - id: flake8
# additional_dependencies: ["flake8-bugbear"]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.8.0
hooks:
# Enforce that noqa annotations always occur with specific codes.
# Sample annotations: # noqa: F401, # noqa: F401,W203
- id: python-check-blanket-noqa
# Prevent common mistakes of assert mck.not_called(),
# assert mck.called_once_with(...) and mck.assert_called.
- id: python-check-mock-methods
# A quick check for the eval() built-in function
- id: python-no-eval
# A quick check for the deprecated .warn() method of python loggers
- id: python-no-log-warn
# Enforce that python3.6+ type annotations are used instead of
# type comments
- id: python-use-type-annotations
# Detect common mistake of using single backticks when writing rst
- id: rst-backticks
# Detect mistake of rst directive not ending with double colon
- id: rst-directive-colons
#Detect mistake of inline code touching normal text in rst
- id: rst-inline-touching-normal
# Forbid files which have a UTF-8 Unicode replacement character
- id: text-unicode-replacement-char
# isort
- repo: https://github.com/timothycrosley/isort
rev: 5.8.0
hooks:
- id: isort
additional_dependencies: [ toml ]
# format: black
- repo: https://github.com/ambv/black
rev: 20.8b1
hooks:
- id: black
# flake8
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.0
hooks:
- id: flake8
additional_dependencies: [ "flake8-bugbear" ]
# check docstrings
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.0.0
hooks:
- id: pydocstyle
args: [ "--ignore=D10,D21,D202" ]
# static type checking with mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.812
hooks:
- id: mypy
- repo: https://github.com/econchick/interrogate
rev: 1.3.2
hooks:
- id: interrogate
args: [tests]
language_version: python3.9
# vulture
- repo: https://github.com/jendrikseipp/vulture
rev: "v2.3"
hooks:
- id: vulture