Skip to content

Commit aa30065

Browse files
committed
add precommit configs
1 parent 3a66d58 commit aa30065

File tree

2 files changed

+77
-1
lines changed

2 files changed

+77
-1
lines changed

.github/workflows/lint.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Python Tests
1+
name: Pipeline Lint
22

33
on:
44
pull_request:
@@ -8,6 +8,9 @@ concurrency:
88
group: tests-${{ github.ref }}
99
cancel-in-progress: true
1010

11+
defaults:
12+
run:
13+
shell: bash -eux {0}
1114

1215
jobs:
1316

.pre-commit-config.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: check-added-large-files
6+
- id: check-case-conflict
7+
- id: check-toml
8+
- id: check-yaml
9+
exclude: template.yaml
10+
- id: debug-statements
11+
- id: end-of-file-fixer
12+
exclude: WHEEL
13+
exclude_types: [json]
14+
- id: forbid-new-submodules
15+
- id: trailing-whitespace
16+
exclude: .patch
17+
exclude_types: [json]
18+
19+
- repo: local
20+
hooks:
21+
- id: synchro
22+
name: synchro
23+
entry: bash ./tools/synchro.sh
24+
language: python
25+
require_serial: true
26+
additional_dependencies:
27+
- ruff==0.1.3
28+
- unasync
29+
30+
- repo: https://github.com/astral-sh/ruff-pre-commit
31+
# Ruff version.
32+
rev: v0.1.3
33+
hooks:
34+
- id: ruff
35+
args: ["--fix", "--show-fixes"]
36+
- id: ruff-format
37+
38+
- repo: https://github.com/adamchainz/blacken-docs
39+
rev: "1.16.0"
40+
hooks:
41+
- id: blacken-docs
42+
additional_dependencies:
43+
- black==22.3.0
44+
45+
- repo: https://github.com/pre-commit/pygrep-hooks
46+
rev: "v1.10.0"
47+
hooks:
48+
- id: rst-backticks
49+
- id: rst-directive-colons
50+
- id: rst-inline-touching-normal
51+
52+
# We use the Python version instead of the original version which seems to require Docker
53+
# https://github.com/koalaman/shellcheck-precommit
54+
- repo: https://github.com/shellcheck-py/shellcheck-py
55+
rev: v0.9.0.6
56+
hooks:
57+
- id: shellcheck
58+
name: shellcheck
59+
args: ["--severity=warning"]
60+
stages: [manual]
61+
62+
- repo: https://github.com/sirosen/check-jsonschema
63+
rev: 0.29.0
64+
hooks:
65+
- id: check-github-workflows
66+
- id: check-github-actions
67+
- id: check-jsonschema
68+
files: .*/(database|indexes)/.json$
69+
70+
- repo: https://github.com/codespell-project/codespell
71+
rev: "v2.2.6"
72+
hooks:
73+
- id: codespell

0 commit comments

Comments
 (0)