Skip to content

Commit 1fe034e

Browse files
danielkivclaude
andcommitted
Add pre-commit config with ruff and prettier hooks
- Add .pre-commit-config.yaml with ruff (check + format) and prettier hooks - Extend ruff and prettier hooks to cover Jupyter notebooks, YAML, and CSS - Add ruff format --check to CI lint workflow - Add pre-commit to dev dependencies Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 54b92a0 commit 1fe034e

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ jobs:
1414
- uses: actions/setup-python@v5
1515
with:
1616
python-version: "3.12"
17-
- run: pip install ruff>=0.5.0
17+
- run: pip install "ruff>=0.5.0"
1818
- run: ruff check src/
19+
- run: ruff format --check src/

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/mirrors-prettier
3+
rev: v3.1.0
4+
hooks:
5+
- id: prettier
6+
types_or: [markdown, yaml, css]
7+
8+
- repo: https://github.com/astral-sh/ruff-pre-commit
9+
rev: v0.14.3
10+
hooks:
11+
- id: ruff
12+
types_or: [python, jupyter]
13+
args: ["--fix", "--show-fixes"]
14+
- id: ruff-format
15+
types_or: [python, jupyter]

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ dev = [
6868
"pytest-cov>=4.1",
6969
"pytest-xdist>=3.0",
7070
"ruff>=0.5.0",
71+
"pre-commit>=3.0",
7172
]
7273

7374
[project.scripts]

0 commit comments

Comments
 (0)