Skip to content

feat(cli): add ruff linter (Google style + C4) and apply-sensors target#11

Merged
deimagjas merged 1 commit into
mainfrom
feat/ruff-google-style
May 15, 2026
Merged

feat(cli): add ruff linter (Google style + C4) and apply-sensors target#11
deimagjas merged 1 commit into
mainfrom
feat/ruff-google-style

Conversation

@deimagjas
Copy link
Copy Markdown
Owner

Summary

  • Configures ruff in app/cli/pyproject.toml to enforce the Google Python Style Guide (pydocstyle convention) plus the C4 rule family. Active rule groups: E/W/F/I/N/D/UP/B/C4/SIM/RET/PTH/ARG/ERA/A/TID. Line length 100, per-file-ignores carve tests out of docstring + unused-arg rules.
  • New Makefile target apply-sensors (lint + unit tests + mutation gate, no acceptance) plus reusable sub-targets lint and unit-test.
  • Fixes every finding (33 in total): renames the local varsmake_vars in 7 sites, adds module/package/function docstrings, sorts imports, and collapses nested with statements via the parenthesized context manager. ruff format applied across app/cli/.
  • Documents the Google rules that ruff cannot enforce in the root CLAUDE.md under a new section "Python code conventions (app/cli/)" (Google docstring sections, TODO(@user):, TYPE_CHECKING, assert boundaries, exception specificity, typer.echo vs logging, naming, etc.).

Test plan

  • cd app/cli && uv run ruff check . — exits 0, "All checks passed!"
  • uv run ruff format --check . — exits 0, no pending changes
  • uv run pytest tests --ignore=tests/acceptance70/70 passed
  • make apply-sensors — lint clean, unit tests green, mutation 98.6% (71/72) ≥ 70% gate
  • uv run q --help smoke test still renders all commands
  • make acceptance-test still passes (independent of this change — should be verified once before merge)

🤖 Generated with Claude Code

Configure ruff in app/cli/ with Google Python Style Guide conventions plus
the C4 (flake8-comprehensions) rule family. Activates check + format with
line-length=100, pydocstyle Google convention, and per-file-ignores that
exempt tests from docstring and unused-arg rules. Adds a new `apply-sensors`
Makefile target that runs lint, unit tests, and the mutation-testing gate
(without acceptance, by design). Fixes all findings: renames `vars` →
`make_vars` (7 sites), adds module/package/function docstrings, sorts
imports, and collapses nested `with` statements via the parenthesized
context manager. Documents the Google rules that ruff cannot enforce in
the root CLAUDE.md.

Mutation score after the change: 98.6% (71/72).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@deimagjas deimagjas merged commit f2a2fa8 into main May 15, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant