feat: standardize ruff config to line-length=88, select=E,F,I,W #240
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-api!240
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "239-standardize-ruff-config"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Aligns pal-e-api to the platform-wide ruff standard: line-length=88 (ruff/Black default) and lint rules E,F,I,W only (drops N naming rules). Reformats all files and fixes 53 E501 line-too-long violations in strings, comments, and docstrings.
Changes
pyproject.toml-- updatedline-lengthfrom 100 to 88, removed"N"from lint selectsrc/pal_e_docs/-- 33 files reformatted byruff format, plus manual E501 fixes in routes/blocks.py, routes/boards.py, routes/notes.py, routes/projects.py, blocks/parser.py, embedding_worker.pyscripts/-- split long strings in migrate_boards_to_notes.py and migrate_sqlite_to_postgres.pytests/-- 19 test files with long docstrings and string constants wrapped to 88 chars.pre-commit-config.yaml-- verified ruff hooks already present (no change needed)Test Plan
ruff check .-- zero violationsruff format --check .-- all 60 files formattedpytest tests/ -x -q-- 685 passed, 0 failedReview Checklist
line-length = 88andselect = ["E", "F", "I", "W"]ruff check .passes cleanruff format --check .passes cleanRelated Notes
PR #240 Review
DOMAIN REVIEW
Tech stack: Python / FastAPI / SQLAlchemy / Pydantic (pal-e-api).
This PR is a formatting-only change:
pyproject.tomlupdatesline-lengthfrom 100 to 88 and removes theN(naming) rule from ruff'sselectlist. All 38 changed files contain exclusively line-wrapping reformats -- no behavioral or logic changes detected.Ruff config (
pyproject.toml):line-length = 88aligns with Black's default and PEP 8's "strongly recommended" 79-char guideline (88 is the accepted modern standard). Good.select = ["E", "F", "I", "W"]-- removingN(pep8-naming) is a deliberate scope decision per the issue. The remaining ruleset covers pycodestyle errors (E), pyflakes (F), isort (I), and pycodestyle warnings (W). Adequate for a project of this maturity.extend-exclude = ["alembic/versions"]correctly exempts auto-generated migrations. Good.Formatting changes across 38 files -- spot-checked all source files (
auth.py,models.py,schemas.py,main.py,embedding_worker.py,blocks/compiler.py,blocks/parser.py,blocks/sync.py, all 6 route files, both scripts, and representative test files). Every change is one of:No changes to control flow, return values, exception types, query logic, or API contracts.
Test coverage: 685/685 tests pass. Since no new functionality is introduced (formatting-only), no new tests are required. No blocker.
BLOCKERS
None.
NITS
src/pal_e_docs/blocks/parser.pydocstring formatting: The reformatted docstring splits inline annotations across continuation lines using#inside a triple-quoted string:Since this is inside a docstring (not actual Python comments), the
#characters are literal text. The continuation reads like a separate comment line rather than a continuation of the type list. Consider reformatting to keep all types on one line (e.g., shorten to# heading | paragraph | table | code | list | mermaidby abbreviating), or wrap the full list differently. Non-blocking -- purely a readability concern.tests/test_boards.pydocstring split: The test docstring"""Sync works correctly even when plan items exist\non the board (backwards compat)."""wraps mid-sentence. Single-line docstrings are preferred per PEP 257 when possible. Consider rewording to fit 88 chars. Non-blocking.src/pal_e_docs/routes/boards.pycomment split: The comment# Do NOT regress open issues -- if manually moved/# to in_progress/qa, leave itsplits an important behavioral note across two lines. The original single-line version was more scannable. Non-blocking but worth preserving intent clarity.SOP COMPLIANCE
239-standardize-ruff-configreferences #239)pal-e-platform#29)feat: standardize ruff config to line-length=88, select=E,F,I,W)PROCESS OBSERVATIONS
ruff check .+ruff format --check .+ full test suite). All three green per PR body.line-length=88across all Python repos reduces cognitive overhead when context-switching between projects. Good platform hygiene.VERDICT: APPROVED