Skip to content

Commit 1ab8361

Browse files
authored
Add ruff lint and format to pre-commit (#229)
1 parent 8d5c277 commit 1ab8361

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

.pre-commit-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ default_stages: [pre-commit, pre-push]
33
default_language_version:
44
python: python3
55
node: 24.15.0
6+
67
repos:
78
- repo: meta
89
hooks:
910
- id: check-hooks-apply
1011
name: check that hooks apply
1112
description: check that all the hooks apply to the repository
13+
1214
- repo: local
1315
hooks:
1416
- id: prettier
@@ -18,6 +20,7 @@ repos:
1820
files: \.ya?ml$
1921
language: node
2022
additional_dependencies: ['prettier@3.8.3']
23+
2124
- repo: https://github.com/pycqa/isort
2225
rev: 8.0.1
2326
hooks:
@@ -26,14 +29,26 @@ repos:
2629
language: python
2730
types: [python]
2831
files: \.py$
32+
2933
- repo: https://github.com/psf/black-pre-commit-mirror
3034
rev: 26.3.1
3135
hooks:
3236
- id: black
37+
38+
- repo: https://github.com/astral-sh/ruff-pre-commit
39+
rev: v0.15.11
40+
hooks:
41+
# Run the linter.
42+
- id: ruff-check
43+
args: [--fix]
44+
# Run the formatter.
45+
- id: ruff-format
46+
3347
- repo: https://github.com/pypa/pip-audit
3448
rev: v2.10.0
3549
hooks:
3650
- id: pip-audit
51+
3752
- repo: https://github.com/pre-commit/pre-commit-hooks
3853
rev: v6.0.0
3954
hooks:
@@ -54,6 +69,7 @@ repos:
5469
- id: forbid-submodules
5570
- id: mixed-line-ending
5671
- id: trailing-whitespace
72+
5773
- repo: https://github.com/pre-commit/pygrep-hooks
5874
rev: v1.10.0
5975
hooks:
@@ -72,6 +88,7 @@ repos:
7288
- id: text-unicode-replacement-char
7389
name: run check for no unicode replacement char
7490
description: Forbid files which have a UTF-8 Unicode replacement character
91+
7592
- repo: https://github.com/igorshubovych/markdownlint-cli
7693
rev: v0.48.0
7794
hooks:
@@ -81,6 +98,7 @@ repos:
8198
args: [--config=.github/linters/.markdown-lint.yml]
8299
types: [markdown]
83100
files: \.md$
101+
84102
- repo: https://github.com/adrienverge/yamllint
85103
rev: v1.38.0
86104
hooks:

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,11 @@ exclude = '''
2121
[tool.isort]
2222
profile = "black"
2323
line_length = 88
24+
25+
[tool.ruff]
26+
line-length = 88
27+
28+
[tool.ruff.format]
29+
quote-style = "double"
30+
indent-style = "space"
31+
skip-magic-trailing-comma = false

0 commit comments

Comments
 (0)