feat: standardize ruff config to line-length=88, select=E,F,I,W #10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "9-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 minio-api to the platform-wide ruff standard: line-length=88 (ruff/Black default) with lint rules E,F,I,W only. Adds a
.pre-commit-config.yamlwith ruff hooks for local enforcement.Changes
pyproject.toml-- changedline-lengthfrom 120 to 88 (select was already correct).pre-commit-config.yaml-- new file withruff(lint + fix) andruff-formathooks pinned to v0.15.2src/minio_api/main.py-- reformatted + wrapped long error message stringsrc/minio_api/dependencies.py-- reformattedsrc/minio_api/permissions.py-- reformattedsrc/minio_api/schemas.py-- reformattedsrc/minio_api/routes/buckets.py-- reformattedsrc/minio_api/routes/objects.py-- reformatted + wrapped long string literals (Content-Disposition, 413 detail)src/minio_api/routes/presign.py-- reformattedsrc/minio_api/routes/multipart.py-- reformattedtests/test_auth.py-- reformattedtests/test_auth_middleware.py-- reformatted + shortened docstrings exceeding 88 charstests/test_buckets.py-- reformattedtests/test_objects.py-- reformattedtests/test_multipart.py-- reformattedtests/test_permissions.py-- reformattedTest Plan
ruff check .-- zero violationsruff format --check .-- all 20 files formattedpytestunit tests -- 63/63 passed (auth, auth_middleware, permissions)Review Checklist
Related Notes
forgejo_admin/pal-e-platform#29pal-e-platformQA Review
Config (pyproject.toml):
line-lengthcorrectly changed 120 -> 88.selectwas already["E", "F", "W", "I"]-- no change needed. Ruff version pinned atv0.15.2in both pyproject.toml and pre-commit config. Clean.Pre-commit (.pre-commit-config.yaml): Both
ruff --fixandruff-formathooks present. Version matches dev dependency. Clean.Source reformatting (14 files): All changes are mechanical line wrapping from the narrower line length. No logic changes anywhere. The 5 manual E501 fixes are correct:
main.py-- error message string split preserves contentobjects.py-- Content-Disposition uses parenthesized expression (valid Python)objects.py-- 413 detail message split preserves same user-facing stringtest_auth_middleware.py-- two docstrings shortened without losing meaningVerification:
ruff check .-- zero violationsruff format --check .-- 20/20 files cleanpytest-- 63/63 unit tests pass, no regressionsNo issues found. Purely mechanical formatting standardization with no behavioral changes.
VERDICT: APPROVED
PR #10 Review
DOMAIN REVIEW
Tech stack: Python / FastAPI / Pydantic / ruff / pre-commit
This PR is a formatting-only change: line-length reduced from 120 to 88, with ruff auto-format applied across 16 files plus a new
.pre-commit-config.yamlfor local enforcement.Ruff config (
pyproject.toml)line-length = 88-- correct (ruff/Black default, platform convention).select = ["E", "F", "W", "I"]-- correct (platform convention). Was already set; no change needed.target-version = "py312"-- correct.Pre-commit config (
.pre-commit-config.yaml)rev: v0.15.2matchesruff==0.15.2pinned in[project.optional-dependencies] dev. Version sync is correct.ruff(lint + fix) runs beforeruff-format.Formatting verification
src/andtests/files for lines exceeding 88 characters: zero matches. The formatter was applied completely.auth.py,conftest.py,test_presign.py,__init__.pyfiles,routes/__init__.py) were already within 88-char limits. No missed files.Behavioral integrity
test_auth_middleware.pywere shortened to fit within 88 chars (lines 157, 200 in the new file). These are fixture/test method docstrings -- purely descriptive, no behavioral impact.objects.py(413 detail) was split across two f-string literals using implicit concatenation. The runtime string is semantically identical.Content-Dispositionheader value inobjects.pywrapped with parentheses -- identical runtime value.BLOCKERS
None.
This is a pure formatting/tooling PR. No new functionality, so the "new functionality must have tests" criterion does not apply. No user input handling changes. No secrets. No auth logic changes.
NITS
.pre-commit-config.yamlenforces formatting locally but the Woodpecker pipeline (issue #8, still open) would be the place to addruff check . && ruff format --check .as a CI gate. Not a blocker for this PR -- just noting the enforcement gap until CI is wired.SOP COMPLIANCE
9-standardize-ruff-configreferences issue #9)forgejo_admin/pal-e-platform#29)Minor template note: PR body uses "Review Checklist" and "Related Notes" instead of the standard "Related" section heading. Non-blocking.
PROCESS OBSERVATIONS
VERDICT: APPROVED