-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.pre-commit-config.yaml
87 lines (87 loc) · 2.51 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
# https://pre-commit.com/
#
# Before first use: `pre-commit install`
# To run: `pre-commit run --all-files`
# To update: `pre-commit autoupdate`
# - &flake8_dependencies below needs updated manually
fail_fast: true
default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-ast
- id: check-toml
- id: check-yaml
# - id: check-executables-have-shebangs
- id: check-vcs-permalinks
- id: destroyed-symlinks
- id: detect-private-key
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
- id: trailing-whitespace
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.24
hooks:
- id: validate-pyproject
name: Validate pyproject.toml
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
args: [--in-place]
- repo: https://github.com/pycqa/isort
rev: 6.0.1
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py39-plus]
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 7.1.2
hooks:
- id: flake8
args: ["--config=.flake8"]
additional_dependencies: &flake8_dependencies
# These versions need updated manually
- flake8==7.1.2
- flake8-comprehensions==3.16.0
- flake8-bugbear==24.12.12
# - flake8-simplify==0.21.0
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
- id: yesqa
additional_dependencies: *flake8_dependencies
# `pyroma` may help keep our package standards up to date if best practices change.
# This is a "low value" check though and too slow to run as part of pre-commit.
# - repo: https://github.com/regebro/pyroma
# rev: "4.2"
# hooks:
# - id: pyroma
# args: [-n, "10", .]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.31.3
hooks:
- id: check-dependabot
- id: check-github-workflows
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: no-commit-to-branch # no commit directly to main