feat: standardize ruff config to line-length=88, select=E,F,I,W #55

Merged
forgejo_admin merged 1 commit from 54-standardize-ruff-config into main 2026-03-28 19:05:21 +00:00

Summary

Aligns pal-e-mcp to the platform-wide ruff standard (line-length=88, select=E,F,I,W) decided 2026-03-28. Fixes all E501 violations introduced by the shorter line length and adds a pre-commit hook for ruff.

Changes

  • pyproject.toml -- set line-length = 88 (was 120), reorder select to ["E", "F", "I", "W"]
  • .pre-commit-config.yaml -- new file with ruff + ruff-format pre-commit hooks
  • src/pal_e_mcp/tools/__init__.py -- shorten docstring to fit 88 chars
  • src/pal_e_mcp/tools/blocks.py -- wrap long Field descriptions and docstrings into multi-line strings
  • src/pal_e_mcp/tools/boards.py -- wrap long Field descriptions and docstrings into multi-line strings
  • src/pal_e_mcp/tools/links.py -- wrap long Field description and docstring
  • src/pal_e_mcp/tools/notes.py -- wrap long Field descriptions and docstrings into multi-line strings
  • src/pal_e_mcp/tools/projects.py -- wrap long docstring
  • src/pal_e_mcp/tools/repos.py -- reformatted by ruff format
  • tests/test_param_alignment.py -- shorten one long docstring, reformatted by ruff format

Test Plan

  • ruff check . -- zero violations
  • ruff format --check . -- all files formatted
  • pytest tests/ -v -- 61/61 tests pass, no regressions

Review Checklist

  • pyproject.toml has line-length = 88 and select = ["E", "F", "I", "W"]
  • .pre-commit-config.yaml has ruff hook
  • ruff check . passes clean
  • ruff format --check . passes clean
  • All 61 existing tests pass

None.

  • Closes #54
  • Parent: pal-e-platform#29
## Summary Aligns pal-e-mcp to the platform-wide ruff standard (line-length=88, select=E,F,I,W) decided 2026-03-28. Fixes all E501 violations introduced by the shorter line length and adds a pre-commit hook for ruff. ## Changes - `pyproject.toml` -- set `line-length = 88` (was 120), reorder select to `["E", "F", "I", "W"]` - `.pre-commit-config.yaml` -- new file with ruff + ruff-format pre-commit hooks - `src/pal_e_mcp/tools/__init__.py` -- shorten docstring to fit 88 chars - `src/pal_e_mcp/tools/blocks.py` -- wrap long Field descriptions and docstrings into multi-line strings - `src/pal_e_mcp/tools/boards.py` -- wrap long Field descriptions and docstrings into multi-line strings - `src/pal_e_mcp/tools/links.py` -- wrap long Field description and docstring - `src/pal_e_mcp/tools/notes.py` -- wrap long Field descriptions and docstrings into multi-line strings - `src/pal_e_mcp/tools/projects.py` -- wrap long docstring - `src/pal_e_mcp/tools/repos.py` -- reformatted by ruff format - `tests/test_param_alignment.py` -- shorten one long docstring, reformatted by ruff format ## Test Plan - [x] `ruff check .` -- zero violations - [x] `ruff format --check .` -- all files formatted - [x] `pytest tests/ -v` -- 61/61 tests pass, no regressions ## Review Checklist - [x] pyproject.toml has `line-length = 88` and `select = ["E", "F", "I", "W"]` - [x] .pre-commit-config.yaml has ruff hook - [x] `ruff check .` passes clean - [x] `ruff format --check .` passes clean - [x] All 61 existing tests pass ## Related Notes None. ## Related - Closes #54 - Parent: pal-e-platform#29
feat: standardize ruff config to line-length=88, select=E,F,I,W
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
92e240831b
Aligns pal-e-mcp to the platform-wide ruff standard decided 2026-03-28.
Updates pyproject.toml (line-length 120->88, reorders select), adds
.pre-commit-config.yaml with ruff hooks, and fixes all E501 violations
in string literals across tool modules and tests.

Closes #54

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Owner

PR #55 Review

DOMAIN REVIEW

Tech stack: Python / FastMCP / Pydantic / ruff / pre-commit

This PR is a config standardization change -- updating ruff from line-length=120 to line-length=88 and setting select=["E", "F", "I", "W"]. The code changes are exclusively line-wrapping reformats to comply with the shorter line limit, plus a new .pre-commit-config.yaml.

pyproject.toml -- line-length = 88 and select = ["E", "F", "I", "W"] are correctly set. The ruff>=0.15 dev dependency is present.

Source files -- All 8 tool modules (__init__.py, blocks.py, boards.py, links.py, notes.py, projects.py, repos.py, tags.py) and server.py have zero lines exceeding 88 characters. The wrapping style is consistent: long Field(description=...) strings are broken into parenthesized multi-line strings.

Tests -- tests/test_param_alignment.py and tests/conftest.py also have no lines exceeding 88 characters. 61 tests cover the MCP-to-SDK parameter boundary thoroughly (CSV splitting, field renames, JSON parsing, error paths, edge cases).

No behavioral changes -- All diffs are whitespace/line-wrapping only. No logic, imports, or API signatures were modified. This is purely a formatting PR.

BLOCKERS

None.

NITS

  1. Pre-commit ruff version mismatch with CI: .pre-commit-config.yaml pins rev: v0.11.6 but .woodpecker.yml installs ruff==0.15.2 and pyproject.toml requires ruff>=0.15. The pre-commit hook would run ruff 0.11.6 (much older) while CI runs 0.15.2. Different ruff versions can disagree on formatting and rule behavior. Recommend aligning the pre-commit rev to match CI (rev: v0.15.2).

  2. CI lints src/ only, not tests/: .woodpecker.yml runs ruff check src/ and ruff format --check src/, but the test files also contain Python code subject to the same ruff config. The pre-commit hook would catch tests/ locally, but CI would not. Consider adding tests/ to the CI lint commands for parity: ruff check src/ tests/ and ruff format --check src/ tests/.

  3. PR body template: The PR uses ## Related Notes (says "None") and ## Review Checklist which are not in the standard SOP template (## Summary, ## Changes, ## Test Plan, ## Related). Minor deviation -- the required sections are all present, but the extra sections add noise.

SOP COMPLIANCE

  • Branch named after issue (54-standardize-ruff-config matches issue #54)
  • PR body has Summary, Changes, Test Plan, Related
  • Related references plan slug -- says "None" under Related Notes; references pal-e-platform#29 as parent issue but no pal-e-docs plan slug. Acceptable for a config standardization task that likely has no plan.
  • No secrets committed
  • No scope creep -- all changes are directly related to ruff config standardization
  • Commit messages are descriptive

PROCESS OBSERVATIONS

  • Deployment frequency: Zero risk. Config-only change with no behavioral impact on MCP tools.
  • Change failure risk: Very low. No logic changes. The only runtime risk would be if a future ruff version flags something differently, but the existing tests all pass.
  • Pre-commit addition: Good practice. Ensures formatting is caught before push. However, the version skew (nit #1) could cause developer confusion if pre-commit passes locally but CI fails (or vice versa).

VERDICT: APPROVED

## PR #55 Review ### DOMAIN REVIEW **Tech stack**: Python / FastMCP / Pydantic / ruff / pre-commit This PR is a config standardization change -- updating ruff from `line-length=120` to `line-length=88` and setting `select=["E", "F", "I", "W"]`. The code changes are exclusively line-wrapping reformats to comply with the shorter line limit, plus a new `.pre-commit-config.yaml`. **pyproject.toml** -- `line-length = 88` and `select = ["E", "F", "I", "W"]` are correctly set. The `ruff>=0.15` dev dependency is present. **Source files** -- All 8 tool modules (`__init__.py`, `blocks.py`, `boards.py`, `links.py`, `notes.py`, `projects.py`, `repos.py`, `tags.py`) and `server.py` have zero lines exceeding 88 characters. The wrapping style is consistent: long `Field(description=...)` strings are broken into parenthesized multi-line strings. **Tests** -- `tests/test_param_alignment.py` and `tests/conftest.py` also have no lines exceeding 88 characters. 61 tests cover the MCP-to-SDK parameter boundary thoroughly (CSV splitting, field renames, JSON parsing, error paths, edge cases). **No behavioral changes** -- All diffs are whitespace/line-wrapping only. No logic, imports, or API signatures were modified. This is purely a formatting PR. ### BLOCKERS None. ### NITS 1. **Pre-commit ruff version mismatch with CI**: `.pre-commit-config.yaml` pins `rev: v0.11.6` but `.woodpecker.yml` installs `ruff==0.15.2` and `pyproject.toml` requires `ruff>=0.15`. The pre-commit hook would run ruff 0.11.6 (much older) while CI runs 0.15.2. Different ruff versions can disagree on formatting and rule behavior. Recommend aligning the pre-commit rev to match CI (`rev: v0.15.2`). 2. **CI lints `src/` only, not `tests/`**: `.woodpecker.yml` runs `ruff check src/` and `ruff format --check src/`, but the test files also contain Python code subject to the same ruff config. The pre-commit hook would catch `tests/` locally, but CI would not. Consider adding `tests/` to the CI lint commands for parity: `ruff check src/ tests/` and `ruff format --check src/ tests/`. 3. **PR body template**: The PR uses `## Related Notes` (says "None") and `## Review Checklist` which are not in the standard SOP template (`## Summary`, `## Changes`, `## Test Plan`, `## Related`). Minor deviation -- the required sections are all present, but the extra sections add noise. ### SOP COMPLIANCE - [x] Branch named after issue (`54-standardize-ruff-config` matches issue #54) - [x] PR body has Summary, Changes, Test Plan, Related - [ ] Related references plan slug -- says "None" under Related Notes; references `pal-e-platform#29` as parent issue but no pal-e-docs plan slug. Acceptable for a config standardization task that likely has no plan. - [x] No secrets committed - [x] No scope creep -- all changes are directly related to ruff config standardization - [x] Commit messages are descriptive ### PROCESS OBSERVATIONS - **Deployment frequency**: Zero risk. Config-only change with no behavioral impact on MCP tools. - **Change failure risk**: Very low. No logic changes. The only runtime risk would be if a future ruff version flags something differently, but the existing tests all pass. - **Pre-commit addition**: Good practice. Ensures formatting is caught before push. However, the version skew (nit #1) could cause developer confusion if pre-commit passes locally but CI fails (or vice versa). ### VERDICT: APPROVED
forgejo_admin deleted branch 54-standardize-ruff-config 2026-03-28 19:05:21 +00:00
Sign in to join this conversation.
No description provided.