Skip to content

Commit 187f552

Browse files
committed
Add initial linting setup
1 parent 72861c3 commit 187f552

File tree

2 files changed

+128
-0
lines changed

2 files changed

+128
-0
lines changed

.pre-commit-config.yaml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
3+
ci:
4+
autoupdate_schedule: quarterly # low frequency to reduce maintenance noise
5+
6+
repos:
7+
- repo: https://github.com/asottile/add-trailing-comma.git
8+
rev: v3.1.0
9+
hooks:
10+
- id: add-trailing-comma
11+
12+
- repo: https://github.com/asottile/pyupgrade.git
13+
rev: v3.17.0
14+
hooks:
15+
- id: pyupgrade
16+
args:
17+
- --py311-plus
18+
19+
- repo: https://github.com/PyCQA/isort.git
20+
rev: 5.13.2
21+
hooks:
22+
- id: isort
23+
args:
24+
- --honor-noqa
25+
26+
- repo: https://github.com/PyCQA/docformatter.git
27+
rev: v1.7.5
28+
hooks:
29+
- id: docformatter
30+
args:
31+
- --in-place
32+
33+
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
34+
rev: v1.5.5
35+
hooks:
36+
- id: remove-tabs
37+
38+
- repo: https://github.com/python-jsonschema/check-jsonschema.git
39+
rev: 0.29.1
40+
hooks:
41+
- id: check-github-actions
42+
- id: check-github-workflows
43+
files: ^\.github/workflows/[^/]+$
44+
types:
45+
- yaml
46+
- id: check-jsonschema
47+
name: Check GitHub Workflows set timeout-minutes
48+
args:
49+
- --builtin-schema
50+
- github-workflows-require-timeout
51+
files: ^\.github/workflows/[^/]+$
52+
types:
53+
- yaml
54+
- id: check-readthedocs
55+
56+
- repo: https://github.com/pre-commit/pygrep-hooks.git
57+
rev: v1.10.0
58+
hooks:
59+
- id: python-check-blanket-noqa
60+
- id: python-check-mock-methods
61+
- id: python-no-eval
62+
- id: python-no-log-warn
63+
- id: rst-backticks
64+
65+
- repo: https://github.com/pre-commit/pre-commit-hooks.git
66+
rev: v4.6.0
67+
hooks:
68+
# Side-effects:
69+
- id: trailing-whitespace
70+
- id: check-merge-conflict
71+
- id: double-quote-string-fixer
72+
- id: end-of-file-fixer
73+
# Non-modifying checks:
74+
- id: name-tests-test
75+
files: >-
76+
^tests/[^_].*\.py$
77+
- id: check-added-large-files
78+
- id: check-byte-order-marker
79+
- id: check-case-conflict
80+
# disabled due to pre-commit/pre-commit-hooks#159
81+
# - id: check-docstring-first
82+
- id: check-json
83+
- id: check-symlinks
84+
- id: check-yaml
85+
# args:
86+
# - --unsafe
87+
- id: detect-private-key
88+
89+
# Heavy checks:
90+
- id: check-ast
91+
- id: debug-statements
92+
93+
- repo: https://github.com/codespell-project/codespell.git
94+
rev: v2.3.0
95+
hooks:
96+
- id: codespell
97+
exclude: >-
98+
^\.github/\.json-schemas/.*\.json$
99+
100+
- repo: https://github.com/adrienverge/yamllint.git
101+
rev: v1.35.1
102+
hooks:
103+
- id: yamllint
104+
types:
105+
- file
106+
- yaml
107+
args:
108+
- --strict
109+
110+
...

.yamllint

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
3+
extends: default
4+
5+
rules:
6+
indentation:
7+
level: error
8+
indent-sequences: false
9+
truthy:
10+
allowed-values:
11+
- >-
12+
false
13+
- >-
14+
true
15+
- >- # Allow "on" key name in GHA CI/CD workflow definitions
16+
on
17+
18+
...

0 commit comments

Comments
 (0)