-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
124 lines (108 loc) · 3.69 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
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for a list of all hooks
repos:
### GENERAL ###
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v8.0.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ["@commitlint/config-conventional"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-case-conflict
- id: check-symlinks
- id: check-json
exclude: ".devcontainer/devcontainer.json"
- id: check-toml
- id: check-xml
# TODO compare to 'thoughtworks/talisman', 'yelp/detect-secrets', 'githuardian/ggshield'
- id: detect-private-key
# - id: detect-aws-credentials
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.6
hooks:
- id: git-check # Configure in .gitattributes
- id: script-must-have-extension
- id: script-must-not-have-extension
# opinionated code formatter for all things frontend (also includes Markdown, JSON, YAML)
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.2
hooks:
- id: prettier
- repo: https://github.com/adrienverge/yamllint
rev: v1.26.3
hooks:
- id: yamllint
args: [-c=.yamllint]
### PYTHON ###
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.0
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: debug-statements
- id: name-tests-test
- id: requirements-txt-fixer
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.1
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
hooks:
- id: mypy
additional_dependencies: ["attrs>=21.0,<22", "types-PyYAML"] # as per setup.cfg
# pip-compile`s 'requirements.in' files as its recommended to have the 'requirements.txt' version
# checked into source control too.
- repo: https://github.com/jazzband/pip-tools
rev: 6.6.0
hooks:
- id: pip-compile
# the uncompromising (opinionated / barely configurable) PEP8 Python code formatter.
- repo: https://github.com/psf/black
rev: "22.3.0"
hooks:
- id: black
# isort alternative
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.0.1
hooks:
- id: reorder-python-imports
args: [--py37-plus, --add-import, "from __future__ import annotations"]
# a tool designed to find common security issues in Python code.
- repo: https://github.com/PyCQA/bandit
rev: "1.7.4"
hooks:
- id: bandit
# flake8 is a python tool that glues together…
# pycodestyle (befriended with `black` through config changes),
# pyflakes (detects various error by parsing [not importing] source file's),
# mccabe (https://en.wikipedia.org/wiki/Cyclomatic_complexity checker) and
# some third-party plugins
# …to check the style and quality of python code.
- repo: https://github.com/pycqa/flake8
rev: "4.0.1"
hooks:
- id: flake8
default_language_version:
python: python3
ci:
autofix_commit_msg: |
chore(pre-commit): auto fixes from hooks :rotating_light:
for more information, see https://pre-commit.ci
autoupdate_commit_msg: |
chore(pre-commit): autoupdate :arrow_up:
TIP: you can trigger a re-run on a pull request by commenting `pre-commit.ci run` (must appear on a line by itself)
exclude: ".idea"