chore: apply ruff standard (line-length=88, py312, pre-commit) #9

Merged
forgejo_admin merged 1 commit from 8-apply-ruff-standard-convention-python-ru into main 2026-03-29 03:41:02 +00:00

Summary

Aligns gmail-mcp to convention-python-ruff-standard: line-length=88, target-version="py312", select=["E","F","I","W"]. Adds .pre-commit-config.yaml with ruff-format and ruff hooks.

Changes

  • pyproject.toml -- updated ruff config from line-length=120/py310 to line-length=88/py312, reordered select to ["E","F","I","W"]
  • .pre-commit-config.yaml -- created with ruff-pre-commit v0.15.2 (ruff-format + ruff hooks)
  • src/**/*.py (11 files) -- reformatted to 88-char line length, broke long strings to fix 29 E501 violations
  • tests/**/*.py (5 files) -- reformatted to 88-char line length

Test Plan

  • ruff format --check . exits 0
  • ruff check . exits 0 (0 violations)
  • pytest tests/ -v passes (105/105 tests)

Review Checklist

  • ruff format --check . passes
  • ruff check . passes (0 violations)
  • All 105 tests pass
  • .pre-commit-config.yaml has both ruff-format and ruff hooks
  • pyproject.toml matches convention template exactly
  • convention-python-ruff-standard
  • Parent: pal-e-platform#244
  • Closes #8
## Summary Aligns gmail-mcp to convention-python-ruff-standard: line-length=88, target-version="py312", select=["E","F","I","W"]. Adds .pre-commit-config.yaml with ruff-format and ruff hooks. ## Changes - `pyproject.toml` -- updated ruff config from line-length=120/py310 to line-length=88/py312, reordered select to ["E","F","I","W"] - `.pre-commit-config.yaml` -- created with ruff-pre-commit v0.15.2 (ruff-format + ruff hooks) - `src/**/*.py` (11 files) -- reformatted to 88-char line length, broke long strings to fix 29 E501 violations - `tests/**/*.py` (5 files) -- reformatted to 88-char line length ## Test Plan - `ruff format --check .` exits 0 - `ruff check .` exits 0 (0 violations) - `pytest tests/ -v` passes (105/105 tests) ## Review Checklist - [x] `ruff format --check .` passes - [x] `ruff check .` passes (0 violations) - [x] All 105 tests pass - [x] `.pre-commit-config.yaml` has both ruff-format and ruff hooks - [x] pyproject.toml matches convention template exactly ## Related Notes - convention-python-ruff-standard ## Related - Parent: pal-e-platform#244 - Closes #8
chore: apply ruff standard (line-length=88, py312, pre-commit)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
0a3a4b38f9
Update pyproject.toml to convention-python-ruff-standard: line-length=88,
target-version="py312", select=["E","F","I","W"]. Reformat all files and
fix E501 violations. Add .pre-commit-config.yaml with ruff hooks.

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

PR #9 Review

DOMAIN REVIEW

Tech stack: Python / MCP server (gmail-mcp). Convention alignment PR -- applies convention-python-ruff-standard to this repo.

pyproject.toml ruff config verified against convention template:

  • target-version = "py312" -- matches convention (was "py310")
  • line-length = 88 -- matches convention (was 120)
  • select = ["E", "F", "I", "W"] -- matches convention exactly (was ["E", "F", "W", "I"], reordered alphabetically)
  • No extra rules, no extend-exclude (repo has no Alembic) -- correct

.pre-commit-config.yaml verified against convention template:

  • ruff-pre-commit repo with rev: v0.15.2 -- matches convention template
  • Both ruff-format and ruff hooks present -- matches convention requirement
  • File is identical to the convention template

Python file changes (11 src + 5 test files) -- mechanical formatting only:

  • All changes are line wraps at 88 characters -- no logic changes detected
  • Long strings use Python implicit concatenation (adjacent string literals) -- semantically identical at runtime
  • Docstrings reformatted to multi-line PEP 257 style -- no content changes
  • Annotated[...] type hints wrapped across lines -- no behavioral change
  • Parenthesized expressions for ternary/comprehension wrapping -- semantically identical
  • No function signatures changed, no parameters added/removed, no default values changed

String break audit (critical for behavior correctness):

  • accounts.py: ValueError messages -- implicit concat, identical strings
  • reauth.py: "message" value uses ("..." "..." "...") -- parenthesized implicit concat, identical string
  • filters.py: description=(...) -- parenthesized implicit concat, identical string
  • messages.py: description="..." "..." -- implicit concat, identical string
  • All break points occur at whitespace boundaries -- no missing spaces, no accidental word joining

BLOCKERS

None.

NITS

  1. Branch name truncation: 8-apply-ruff-standard-convention-python-ru appears truncated (missing ff-standard suffix). Non-blocking -- the branch correctly references issue #8 and follows kebab-case convention.

SOP COMPLIANCE

  • Branch named after issue (8-apply-ruff-standard-... references issue #8)
  • PR body follows template (Summary, Changes, Test Plan, Related)
  • Related references convention slug (convention-python-ruff-standard) and parent (pal-e-platform#244)
  • Tests exist and pass (105/105 per PR body)
  • No secrets committed
  • No scope creep -- every change is ruff config or mechanical formatting
  • Closes #8 declared in PR body

PROCESS OBSERVATIONS

Clean convention alignment PR. 19 files changed, 412 additions / 120 deletions -- all mechanical. The ruff standard is now consistently applied across gmail-mcp, reducing formatting drift between repos. This brings gmail-mcp into conformance with the platform-wide convention-python-ruff-standard.

DORA impact: Reduces change failure risk (CFR) by eliminating formatting-related review friction. Pre-commit hooks will enforce going forward.

VERDICT: APPROVED

## PR #9 Review ### DOMAIN REVIEW **Tech stack:** Python / MCP server (gmail-mcp). Convention alignment PR -- applies `convention-python-ruff-standard` to this repo. **pyproject.toml ruff config verified against convention template:** - `target-version = "py312"` -- matches convention (was `"py310"`) - `line-length = 88` -- matches convention (was `120`) - `select = ["E", "F", "I", "W"]` -- matches convention exactly (was `["E", "F", "W", "I"]`, reordered alphabetically) - No extra rules, no `extend-exclude` (repo has no Alembic) -- correct **.pre-commit-config.yaml verified against convention template:** - `ruff-pre-commit` repo with `rev: v0.15.2` -- matches convention template - Both `ruff-format` and `ruff` hooks present -- matches convention requirement - File is identical to the convention template **Python file changes (11 src + 5 test files) -- mechanical formatting only:** - All changes are line wraps at 88 characters -- no logic changes detected - Long strings use Python implicit concatenation (adjacent string literals) -- semantically identical at runtime - Docstrings reformatted to multi-line PEP 257 style -- no content changes - `Annotated[...]` type hints wrapped across lines -- no behavioral change - Parenthesized expressions for ternary/comprehension wrapping -- semantically identical - No function signatures changed, no parameters added/removed, no default values changed **String break audit (critical for behavior correctness):** - `accounts.py`: ValueError messages -- implicit concat, identical strings - `reauth.py`: `"message"` value uses `("..." "..." "...")` -- parenthesized implicit concat, identical string - `filters.py`: `description=(...)` -- parenthesized implicit concat, identical string - `messages.py`: `description="..." "..."` -- implicit concat, identical string - All break points occur at whitespace boundaries -- no missing spaces, no accidental word joining ### BLOCKERS None. ### NITS 1. **Branch name truncation**: `8-apply-ruff-standard-convention-python-ru` appears truncated (missing `ff-standard` suffix). Non-blocking -- the branch correctly references issue #8 and follows kebab-case convention. ### SOP COMPLIANCE - [x] Branch named after issue (`8-apply-ruff-standard-...` references issue #8) - [x] PR body follows template (Summary, Changes, Test Plan, Related) - [x] Related references convention slug (`convention-python-ruff-standard`) and parent (`pal-e-platform#244`) - [x] Tests exist and pass (105/105 per PR body) - [x] No secrets committed - [x] No scope creep -- every change is ruff config or mechanical formatting - [x] Closes #8 declared in PR body ### PROCESS OBSERVATIONS Clean convention alignment PR. 19 files changed, 412 additions / 120 deletions -- all mechanical. The ruff standard is now consistently applied across gmail-mcp, reducing formatting drift between repos. This brings gmail-mcp into conformance with the platform-wide `convention-python-ruff-standard`. DORA impact: Reduces change failure risk (CFR) by eliminating formatting-related review friction. Pre-commit hooks will enforce going forward. ### VERDICT: APPROVED
forgejo_admin deleted branch 8-apply-ruff-standard-convention-python-ru 2026-03-29 03:41:02 +00:00
Sign in to join this conversation.
No description provided.