-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
143 lines (130 loc) · 3.9 KB
/
.pre-commit-config.yaml
File metadata and controls
143 lines (130 loc) · 3.9 KB
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
ci:
skip: [pyright]
# exclude: 'scripts/.*|tests/.*'
exclude: 'scripts/.*'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
args:
- --assume-in-merge
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: trailing-whitespace
- id: no-commit-to-branch
- id: pretty-format-json
args: ['--autofix']
# - id: sort-simple-yaml
# files: .pre-commit-config.yaml
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.1
hooks:
- id: mypy
name: mypy
language: python
language_version: python3.12
types: [python]
require_serial: true
verbose: true
additional_dependencies: ['types-requests']
# exclude: "tests"
# args:
# - --ignore-missing-imports
# files: ^(src/|tests/)
- repo: https://github.com/PyCQA/isort
rev: 7.0.0
hooks:
- id: isort
args: ["--profile", "black", "--filter-files", "--combine-as", "honor--noqa"]
- repo: https://github.com/psf/black
rev: 26.1.0
hooks:
- id: black
language_version: python3.10
args: ["--skip-magic-trailing-comma"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- args:
- --py310-plus
id: pyupgrade
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.6
hooks:
- id: remove-tabs
# - repo: https://github.com/commitizen-tools/commitizen
# rev: v2.40.0
# hooks:
# - id: commitizen
# pylint still broken in python 3.12
# - repo: https://github.com/pre-commit/mirrors-pylint
# rev: v3.0.0a5
# hooks:
# - id: pylint
# exclude: "tests"
# name: pylint
# args:
# - --good-names=i,j,_,f
# - --disable=protected-access
# - --disable=no-member
# - --disable=import-error
# - --disable=no-name-in-module
# - --load-plugins=pylint.extensions.docparams
# - --accept-no-param-doc=n
# - --accept-no-raise-doc=n
# - --accept-no-return-doc=n
# - --accept-no-yields-doc=n
- repo: https://github.com/astral-sh/ruff-pre-commit
# ignores
# ANN201 Missing return type annotation for public function
# ANN202 Missing return type annotation for private function (wants -> None everywhere)
# B905 zip() without an explicit strict= parameter
# COM812 Trailing comma missing
# D203 1 blank line required before class docstring
# D213 multi line summary second line
# D400 first line should end with a period
# I001 Import block is un-sorted or un-formatted
# ISC003 Explicitly concatenated string should be implicitly concatenated
# N802 Function name should be lowercase
# N806 Variable in function should be lowercase
# PERF401 Use a list comprehension to create a transformed list
# PGH003 Use specific rule codes when ignoring type issues
# PLR0913 Too many arguments to function call
#
# ERA001 Found commented-out code
# N803 Argument name should be lowercase
# S320 Using `lxml` to parse untrusted data is known to be ... XML attacks
# PLR2004 Magic values
# C901 function is too complex # for iter_at_depth
# PLR0912 too many branches # for iter_at_depth
#
rev: 'v0.14.14'
hooks:
- id: ruff
exclude: "tests"
args:
- --target-version=py38
- --select=ALL
- --ignore=ANN201,ANN202,B905,COM812,D203,D213,D400,I001,ISC003,N802,N806,PERF401,PGH003,PLR0913,ERA001,N803,S320,PLR2004,C901,PLR0912
# # - --fix
# reads pyproject.toml for additional config
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.408
hooks:
- id: pyright