forked from PyLav/PyLav
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
111 lines (110 loc) · 3.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
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
default_language_version:
python: python3.11
exclude: ^.*\.po$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
# Checks for git-related issues
- id: check-case-conflict
- id: check-merge-conflict
# JSON validation
- id: pretty-format-json
args:
- --autofix
- --indent=4
# all files should end with an empty line (for one, it minimizes the diffs)
- id: end-of-file-fixer
# `.gitattributes` should technically already handle this
# but autocrlf can result in local files keeping the CRLF
# which is problematic for some tools
- id: mixed-line-ending
args:
- --fix=lf
# Trailing whitespace is evil
- id: trailing-whitespace
# Syntax validation
- id: check-ast
- id: check-toml
# can be switched to yamllint when this issue gets resolved:
# https://github.com/adrienverge/yamllint/issues/238
- id: check-yaml
- id: debug-statements
- id: check-json
- id: check-symlinks
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.2
hooks:
- id: autoflake
args: [--remove-all-unused-imports, --recursive, --in-place, --remove-unused-variables, --ignore-init-module-imports, --remove-duplicate-keys]
- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: absolufy-imports
exclude: ^docs/
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-print]
files: \.py$
args: [--count, --select, 'E9,F7,F82,F406,F821,T003', --show-source]
- repo: https://github.com/humitos/mirrors-autoflake
rev: v1.1
hooks:
- id: autoflake
files: \.py$
exclude: ^\..*
args: [--in-place]
- repo: https://github.com/sondrelg/pep585-upgrade
rev: v1.0
hooks:
- id: upgrade-type-hints
args: [--futures=true]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.22.0
hooks:
- id: check-github-actions
- id: check-dependabot
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.8.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '4']
- repo: https://github.com/asottile/blacken-docs
rev: 1.13.0
hooks:
- id: blacken-docs
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/MarcoGorelli/auto-walrus
rev: v0.2.2
hooks:
- id: auto-walrus
args: [--line-length, '120']
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py311-plus]
- repo: https://github.com/psf/black
# The `refs/tags/<tag>:refs/tags/<tag>` is needed for black's required-version to work:
# https://github.com/psf/black/issues/2493#issuecomment-1081987650
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/Pierre-Sassoulas/black-disable-checker
rev: v1.1.3
hooks:
- id: black-disable-checker
ci:
autofix_commit_msg: |
[skip ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_commit_msg: '[skip ci] pre-commit autoupdate'
autoupdate_schedule: weekly
submodules: false
skip: [sourcery]