Skip to content

Commit 8728280

Browse files
committed
Standardize on ruff for both linting and formatting
- Remove black from pre-commit configuration - Update Makefile to use 'ruff format' instead of 'black' - Add formatting check to CI workflow - Update ruff pre-commit hook to latest version (v0.6.0) - Update documentation to reflect ruff-only approach - Ensure consistent code formatting across local dev and CI This eliminates potential conflicts between black and ruff formatting and simplifies the toolchain to use ruff for everything.
1 parent bc73e0f commit 8728280

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ jobs:
3535
run: |
3636
basedpyright
3737
38+
- name: Run formatting check
39+
run: |
40+
ruff format --check .
41+
3842
- name: Run linting
3943
run: |
4044
ruff check .

.pre-commit-config.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,12 @@ repos:
1212
- id: detect-private-key
1313

1414
- repo: https://github.com/astral-sh/ruff-pre-commit
15-
rev: v0.1.9
15+
rev: v0.6.0
1616
hooks:
1717
- id: ruff
1818
args: [--fix]
1919
- id: ruff-format
2020

21-
- repo: https://github.com/psf/black
22-
rev: 23.12.1
23-
hooks:
24-
- id: black
25-
language_version: python3.11
26-
2721
- repo: local
2822
hooks:
2923
- id: basedpyright

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ Thank you for your interest in contributing to Curriculum Curator! This document
5555
- Follow PEP 8
5656
- Use type hints where possible
5757
- Maximum line length: 100 characters
58-
- Use `ruff` for linting and formatting
58+
- Use `ruff` for both linting and formatting (no `black`)
59+
- Format code before committing: `ruff format .`
5960

6061
### Commit Messages
6162
Follow conventional commits format:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type-check:
4040
python scripts/check_types.py
4141

4242
format:
43-
black .
43+
ruff format .
4444
ruff check . --fix
4545

4646
# Combined checks

scripts/README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ python scripts/check_types.py
5454

5555
1. **Start development server**: `python scripts/run_dev.py`
5656
2. **Make changes** to code
57-
3. **Run tests**: `python scripts/run_tests.py`
58-
4. **Check types**: `python scripts/check_types.py`
59-
5. **Commit** when all checks pass
57+
3. **Format code**: `ruff format .` (or `make format`)
58+
4. **Run tests**: `python scripts/run_tests.py`
59+
5. **Check types**: `python scripts/check_types.py`
60+
6. **Commit** when all checks pass
61+
62+
## Code Quality Tools
63+
64+
We use `ruff` for both linting and formatting:
65+
- **Format**: `ruff format .`
66+
- **Lint**: `ruff check . --fix`
67+
- **Combined**: `make format` or `make check-all`

0 commit comments

Comments
 (0)