Skip to content

feat: expand ruff lint rules with tier 1+2 quality rulesets#22

Merged
weklund merged 1 commit intomainfrom
feat/expand-ruff-lint-rules
Apr 3, 2026
Merged

feat: expand ruff lint rules with tier 1+2 quality rulesets#22
weklund merged 1 commit intomainfrom
feat/expand-ruff-lint-rules

Conversation

@weklund
Copy link
Copy Markdown
Owner

@weklund weklund commented Apr 3, 2026

Summary

  • Add 12 new ruff rule sets (UP, B, SIM, C4, RUF, PIE, RET, PERF, PT, FURB, FLY) for code quality, bug prevention, modernization, and performance
  • Fix all violations across 75 files via autofix + manual resolution
  • Remove dead code (e.g. useless if-else with identical branches in models.py)
  • Replace ambiguous unicode (en-dashes → hyphens), add raw strings to regex patterns, convert loops to comprehensions, simplify control flow
  • Add sensible ignores for opinionated test-style rules (SIM117, PT018, PT019, PT017)
  • C90 (mccabe complexity) left commented out — 16 functions exceed threshold, tracked as future refactoring

All 1480 unit tests pass. make lint, make test, and make test-catalog all green. Pre-existing failures in integration/smoke tests are unchanged (see #20, #21).

Test plan

🤖 Generated with Claude Code

Add 12 new ruff rule sets for code quality, bug prevention, and
modernization. Fix all auto-fixable violations and manually resolve
remaining issues including dead code, ambiguous unicode, raw regex
strings, loop-to-comprehension conversions, and control flow
simplification.

New rule sets: UP (pyupgrade), B (bugbear), SIM (simplify), C4
(comprehensions), RUF (ruff-specific), PIE (misc cleanup), RET
(return simplification), PERF (performance), PT (pytest style),
FURB (modernization), FLY (f-string conversion).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@weklund weklund merged commit 75490f6 into main Apr 3, 2026
2 checks passed
weklund added a commit that referenced this pull request Apr 4, 2026
🤖 I have created a release *beep* *boop*
---


## [0.3.5](v0.3.4...v0.3.5)
(2026-04-04)


### Features

* expand ruff lint rules with tier 1+2 quality rulesets
([#22](#22))
([75490f6](75490f6))


### Refactors

* **tests:** replace brittle mock-heavy tests with behavioral tests and
shared factories ([#32](#32))
([9af6078](9af6078))
  - `FakeServiceLayer` replaces 10-deep `@patch` stacks in `TestRunUp`
  - Consolidate ~50 duplicate helpers into `tests/factories.py`
  - AAA comments (`# Arrange`, `# Act`, `# Assert`) across 17 test files
  - `make lint` now includes pyright for shift-left type checking
  - Net: -577 lines, 1,481 tests pass, 73% reduction in `@patch` usage

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Wes Eklund <s.wes35@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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