Skip to content

Commit c7a19c2

Browse files
mdzclaude
andauthored
use ruff instead of flake8+black (#42)
* use ruff instead of flake8+black * Migrate dev dependencies to [dependency-groups] Allows `uv sync --dev` to work as expected instead of requiring `--extra dev`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Replace black/flake8 with ruff in CI and dependencies Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 13fea69 commit c7a19c2

4 files changed

Lines changed: 474 additions & 561 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
- name: Add uv to PATH
2424
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
2525
- name: Install all dependencies
26-
run: uv sync --extra dev
27-
- name: Lint with flake8
28-
run: uv run flake8 smarttub tests --show-source --statistics
26+
run: uv sync --dev
27+
- name: Lint with ruff
28+
run: uv run ruff check smarttub tests
2929
- name: Test with pytest
3030
run: uv run pytest --cov-fail-under=100 --cov-report=term-missing

.pre-commit-config.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,16 @@ repos:
55
- id: end-of-file-fixer
66
- id: trailing-whitespace
77
- id: check-yaml
8-
- repo: https://github.com/psf/black
9-
rev: 25.1.0
8+
- repo: https://github.com/astral-sh/ruff-pre-commit
9+
# Ruff version.
10+
rev: v0.1.6
1011
hooks:
11-
- id: black
12+
# Run the linter.
13+
- id: ruff
1214
args:
13-
- --safe
14-
- --quiet
15-
files: ^((smarttub|tests)/.+)?[^/]+\.py$
16-
- repo: https://github.com/pycqa/flake8
17-
rev: 7.3.0
18-
hooks:
19-
- id: flake8
15+
- --fix
16+
# Run the formatter.
17+
- id: ruff-format
2018
- repo: local
2119
hooks:
2220
- id: pytest

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@ dependencies = [
1212
"python-dateutil>=2.8.1"
1313
]
1414

15-
[project.optional-dependencies]
15+
[dependency-groups]
1616
dev = [
1717
"pytest",
1818
"pytest-asyncio",
1919
"pytest-cov",
2020
"aresponses",
2121
"pre-commit",
22-
"black",
23-
"flake8",
22+
"ruff",
2423
"twine"
2524
]
2625

0 commit comments

Comments
 (0)