Skip to content

Commit 20aae09

Browse files
shaanmajidsharkdp
authored andcommitted
chore: organize pre-commit priority groups
1 parent 737849c commit 20aae09

1 file changed

Lines changed: 27 additions & 23 deletions

File tree

.pre-commit-config.yaml

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,28 @@ repos:
7474
- id: check-github-workflows
7575
priority: 0
7676

77+
# `actionlint` hook, for verifying correct syntax in GitHub Actions workflows.
78+
# Some additional configuration for `actionlint` can be found in `.github/actionlint.yaml`.
79+
- repo: https://github.com/rhysd/actionlint
80+
rev: 914e7df21a07ef503a81201c76d2b11c789d3fca # frozen: v1.7.12
81+
hooks:
82+
- id: actionlint
83+
stages:
84+
# This hook is disabled by default, since it's quite slow.
85+
# To run all hooks *including* this hook, use `uvx prek run -a --hook-stage=manual`.
86+
# To run *just* this hook, use `uvx prek run -a actionlint --hook-stage=manual`.
87+
- manual
88+
args:
89+
- "-ignore=SC2129" # ignorable stylistic lint from shellcheck
90+
- "-ignore=SC2016" # another shellcheck lint: seems to have false positives?
91+
language: golang # means renovate will also update `additional_dependencies`
92+
additional_dependencies:
93+
# actionlint has a shellcheck integration which extracts shell scripts in `run:` steps from GitHub Actions
94+
# and checks these with shellcheck. This is arguably its most useful feature,
95+
# but the integration only works if shellcheck is installed
96+
- "github.com/wasilibs/go-shellcheck/cmd/shellcheck@v0.11.1"
97+
priority: 0
98+
7799
- repo: https://github.com/executablebooks/mdformat
78100
rev: 82912cdaea4fb830f751504486a7879c70526547 # frozen: 1.0.0
79101
hooks:
@@ -102,14 +124,18 @@ repos:
102124
- id: ruff-format
103125
exclude: crates/ty_python_semantic/resources/corpus/
104126
priority: 0
127+
128+
# Priority 1: Second-pass fixers (e.g., markdownlint-fix runs after mdformat).
129+
- repo: https://github.com/astral-sh/ruff-pre-commit
130+
rev: 745be0411e3c150e246d527e531e5a221b8c3462 # frozen: v0.15.19
131+
hooks:
105132
- id: ruff-check
106133
args: [--fix, --exit-non-zero-on-fix]
107134
types_or: [python, pyi]
108135
exclude: crates/ty_python_semantic/resources/corpus/
109136
require_serial: true
110137
priority: 1
111138

112-
# Priority 1: Second-pass fixers (e.g., markdownlint-fix runs after mdformat).
113139
- repo: https://github.com/igorshubovych/markdownlint-cli
114140
rev: e72a3ca1632f0b11a07d171449fe447a7ff6795e # frozen: v0.48.0
115141
hooks:
@@ -132,25 +158,3 @@ repos:
132158
files: '^crates/.*/resources/(mdtest|lint_docs)/.*\.md$'
133159
pass_filenames: true
134160
priority: 2
135-
136-
# `actionlint` hook, for verifying correct syntax in GitHub Actions workflows.
137-
# Some additional configuration for `actionlint` can be found in `.github/actionlint.yaml`.
138-
- repo: https://github.com/rhysd/actionlint
139-
rev: 914e7df21a07ef503a81201c76d2b11c789d3fca # frozen: v1.7.12
140-
hooks:
141-
- id: actionlint
142-
stages:
143-
# This hook is disabled by default, since it's quite slow.
144-
# To run all hooks *including* this hook, use `uvx prek run -a --hook-stage=manual`.
145-
# To run *just* this hook, use `uvx prek run -a actionlint --hook-stage=manual`.
146-
- manual
147-
args:
148-
- "-ignore=SC2129" # ignorable stylistic lint from shellcheck
149-
- "-ignore=SC2016" # another shellcheck lint: seems to have false positives?
150-
language: golang # means renovate will also update `additional_dependencies`
151-
additional_dependencies:
152-
# actionlint has a shellcheck integration which extracts shell scripts in `run:` steps from GitHub Actions
153-
# and checks these with shellcheck. This is arguably its most useful feature,
154-
# but the integration only works if shellcheck is installed
155-
- "github.com/wasilibs/go-shellcheck/cmd/shellcheck@v0.11.1"
156-
priority: 0

0 commit comments

Comments
 (0)