feat: standardize ruff config (line-length=88, select=E,F,I,W) #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "5-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
Align minio-sdk ruff configuration to the platform-wide standard:
line-length=88,select=["E", "F", "I", "W"]. Reformat all source and test files to the new line length. Add ruff pre-commit hook.Changes
pyproject.toml--line-length120 -> 88,selectreordered to["E", "F", "I", "W"].pre-commit-config.yaml-- new file with ruff and ruff-format hooks (pinned to v0.15.2)src/minio_sdk/client.py-- reformatted long lines (function signatures, URL encoding calls)src/minio_sdk/exceptions.py-- reformatted__init__signaturesrc/minio_sdk/signer.py-- reformatted long lines (function signatures, f-strings, docstring)src/minio_sdk/xml_parser.py-- reformatted XML builder string concatenationstests/test_client.py-- reformatted long method signatures and callstests/test_client_unit.py-- reformatted XML string literals and mock patch callstests/test_signer.py-- reformatted long assertion stringstests/test_xml_parser.py-- reformatted LifecycleRule constructor callsTest Plan
ruff check src/ tests/-- zero violationsruff format --check src/ tests/-- all files formattedpytest tests/test_signer.py tests/test_xml_parser.py tests/test_client_unit.py -v-- 56/56 passedtest_client.py) skipped (require live MinIO credentials)Review Checklist
ruff format --check .passes cleanruff check .passes cleanRelated Notes
No pal-e-docs notes affected.
Related
QA Review -- PR #6
Scope Alignment (Issue #5)
pyproject.tomlhasline-length = 88-- matches acceptance criteriapyproject.tomlhasselect = ["E", "F", "I", "W"]-- matches acceptance criteria.pre-commit-config.yamladded with ruff hook -- matches acceptance criteriaruff check .passes clean -- confirmed in test planruff format --check .passes clean -- confirmed in test planConfig Review
line-lengthcorrectly changed from 120 to 88selectreordered from["E", "F", "W", "I"]to["E", "F", "I", "W"](alphabetical)v0.15.2, matching the ruff version in pyproject.tomldevdeps -- good consistencyCode Changes Review
All changes are mechanical line-wrapping from the line-length reduction. Verified:
test_client_unit.pyXML error messages)signer.pycorrectly preserves the space after comma in the Authorization header formatget_signing_keyreformatted to fit within 88 chars -- content preservedNit (non-blocking)
signer.pydocstring wrapping of the HMAC chain is slightly awkward with mismatched parentheses across lines. Consider a simpler representation, but this is cosmetic and non-blocking.Test Verification
VERDICT: APPROVED
PR #6 Review
DOMAIN REVIEW
Tech stack: Python 3.12 / pure stdlib + requests / ruff / pytest / pre-commit
This PR is a formatting-only change: ruff config standardization from
line-length=120toline-length=88,selectreordering to alphabetical["E", "F", "I", "W"], and addition of.pre-commit-config.yaml. All 10 changed files are reformats of long lines to comply with the new width.Ruff config (
pyproject.toml):line-lengthcorrectly changed 120 -> 88.selectreordered to alphabetical["E", "F", "I", "W"]per platform convention.target-version = "py312"retained -- correct.ruff==0.15.2matches.pre-commit-config.yamlrev: v0.15.2-- good version pinning.Pre-commit config (
.pre-commit-config.yaml):v0.15.2-- matches pyproject.toml.ruff(with--fix) andruff-format-- correct pattern.Reformatting correctness: Reviewed all 8 reformatted Python files against the originals. Every change is a mechanical line-wrap -- no logic changes, no behavioral modifications. The reformats follow standard ruff format output: break after opening parenthesis, align parameters, close parenthesis on its own line.
Residual long lines: I identified several string literals that still exceed 88 characters after the diff is applied (e.g.,
xml_parser.pylines 309, 335, 345;client.pylines 241, 370). This is correct behavior --ruff formatintentionally does not break string literals that cannot be split without changing semantics, and E501 is auto-disabled when the formatter is active. These would pass bothruff format --checkandruff checkcleanly.Docstring reformat note (
signer.pyget_signing_key): The original docstringsigning_key = HMAC(HMAC(HMAC(HMAC("AWS4" + secret, date), region), service), "aws4_request")is reformatted across 3 lines. The new version is less readable as a mathematical expression, but this is the formatter's output and manually overriding it would create a maintenance burden. Acceptable.BLOCKERS
None.
NITS
src/minio_sdk/signer.py,get_signing_key): The reformatted HMAC chain docstring lost clarity compared to the original one-liner. Consider wrapping it in a code block (triple backticks or indented block) so the formatter leaves it alone. Non-blocking since this is formatter output.SOP COMPLIANCE
5-standardize-ruff-configmatches issue #5pal-e-platform#29referenced.envfiles, no hardcoded credentialsPROCESS OBSERVATIONS
selectalphabetical ordering is a small but useful standardization for cross-repo consistency.VERDICT: APPROVED