-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
135 lines (124 loc) · 4.11 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
#
# This is the configuration file of the pre-commit framework for this repository:
# https://pypi.org/project/pre-commit
#
# pre-commit runs in the GitHub Workflow of this project on each push and PR.
# Additionally, you can run it locally for faster fixing of issues using
# $ pip3 install pre-commit -r requirements-dev.txt
#
# On the initial run, pre-commit downloads its checkers, subsequent runs are fast:
#
# $ pre-commit run # automatically checks which checks are needed.
# $ pre-commit run -a # runs all fixes and checks, even when not needed
#
# When this works, you can enable it as the pre-commit hook for this git clone:
# $ pre-commit install
# $ pre-commit install --hook-type pre-push
#
# You can skip checks if you commit very often you don't want them to run, e.g:
# export SKIP=m.pylint;git commit -m "quick save" (or for --amend)
#
# For more customizations, see https://pre-commit.com/#temporarily-disabling-hooks
# and https://pre-commit.com/#confining-hooks-to-run-at-certain-stages (e.g push)
#
# After this, the pre-commit fixes and checks run when you commit an update.
#
# You can also automatically set pre-commit as pre-commit hook for new git clones:
# $ git config --global init.templateDir ~/.git-template
# $ pre-commit init-templatedir ~/.git-template
#
# Further information:
# https://pre-commit.com/#automatically-enabling-pre-commit-on-repositories
# All hooks: https://pre-commit.com/hooks.html
fail_fast: false
default_stages: [pre-commit, pre-push]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
# https://github.com/pre-commit/pre-commit-hooks/blob/main/README.md:
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: cli/_vendor
- id: mixed-line-ending
args: ['--fix=lf']
- id: check-added-large-files
args: ['--maxkb=40']
- id: check-executables-have-shebangs
- id: debug-statements
- id: check-shebang-scripts-are-executable
- id: check-merge-conflict
- id: check-yaml
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
args: ["--in-place", "--remove-unused-variables", "--remove-all-unused-imports"]
language: python
files: \.py$
exclude: cli/_vendor
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
args: [--safe, --quiet]
exclude: cli/_vendor
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
- id: mypy
name: Run mypy
exclude: cli/_vendor
- repo: local
hooks:
- id: git-diff
name: Show not staged changes (fixups may make them too)
entry: git diff --exit-code
language: system
pass_filenames: false
always_run: true
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
- repo: https://github.com/openstack/bashate
rev: 2.1.1
hooks:
- id: bashate
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.42.0
hooks:
- id: markdownlint
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.387
hooks:
- id: pyright
name: Run pyright
exclude: cli/_vendor
additional_dependencies:
- typing-extensions
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
exclude: cli/_vendor
additional_dependencies:
- tomli
- repo: https://github.com/xenserver-next/pre-commit-pytype
rev: '2024.10.11'
hooks:
- id: pytype
# Note: Pytype does not support Python 3.12 yet:
# https://google.github.io/pytype/support.html
#
# If your pre-commit has been installed in a Python3.12 environment,
# you need to uncomment the next line to run pytype in a Python3.10 environment:
# that also the GitHub Action currently uses:
# language_version: "3.10"
name: Run pytype
args: ['cli/check.py']
- repo: https://github.com/pylint-dev/pylint
rev: v3.3.1
hooks:
- id: pylint
exclude: cli/_vendor