Skip to content

chore(lint): clean up ruff/black/isort/prettier drift across main#202

Merged
MartinCastroAlvarez merged 1 commit into
mainfrom
chore/lint-cleanup-main
May 26, 2026
Merged

chore(lint): clean up ruff/black/isort/prettier drift across main#202
MartinCastroAlvarez merged 1 commit into
mainfrom
chore/lint-cleanup-main

Conversation

@MartinCastroAlvarez
Copy link
Copy Markdown
Owner

The local-only lint gate (SECURITY.md §8, no CI) had drifted — clean ruff check reported 20 errors, black wanted 13 files, prettier flagged 2 frontend files. This brings the tree fully green.

  • filters.py S112 → the broken-filter skip now logger.debug(..., exc_info=True) (no silent swallow; behavior unchanged).
  • views.py SIM102 → nested auth-gate ifs collapsed into one and (logic identical).
  • tests → SIM105/117/118, E741, E501, E402 (hoisted test_spa_index.py branding imports).
  • black (12 files) + isort + prettier (DetailPage, HomePage).

Verified: ruff/black/isort/prettier/typecheck all green; 353 pytest passed. No behavior change. Self-merging under full-tier authorization.

The local-only lint gate (SECURITY.md §8 — no CI) had drifted: a clean
`ruff check` reported 20 errors, `black --check` wanted 13 files, and
`prettier --check` flagged 2 frontend files. This brings the tree back
to fully green.

Backend (ruff):
- `api/filters.py` — S112: the broken-SimpleListFilter skip now logs at
  debug (`logger.debug(..., exc_info=True)`) instead of silently
  swallowing; behavior unchanged, observability improved.
- `views.py` — SIM102: collapse the nested `if not is_admin_user: if
  not REACT_LOGIN:` auth gate into a single `and` (logic identical).
- tests — SIM105 (`contextlib.suppress`), SIM117 (single `with`),
  SIM118 (`key in dict`), E741 (`l` → `opt`), E501 (wrap), E402
  (`test_spa_index.py` branding-section imports hoisted to the top
  block, dedup'd).

Formatting:
- `black` reformatted 12 files; `isort --force-single-line` applied;
  `prettier --write` on `DetailPage.tsx` + `HomePage.tsx`.

Verified green: `ruff check`, `black --check`, `isort --check-only`,
`prettier --check` (frontend), `pnpm -r typecheck` (7 packages),
`pytest` (353 passed). No behavior change — pure lint/format + the one
debug-log addition.

Tier 3 (touches `api/` + `views.py`) — self-merging under the
repo-owner's full-tier authorization; no logic change, full suite green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MartinCastroAlvarez MartinCastroAlvarez merged commit ecfc785 into main May 26, 2026
2 checks passed
@MartinCastroAlvarez MartinCastroAlvarez deleted the chore/lint-cleanup-main branch May 26, 2026 21:46
MartinCastroAlvarez pushed a commit that referenced this pull request May 26, 2026
Ships the batch merged since 0.2.0a2:
- SECURITY: SW message-handler origin check (#208, CodeQL
  js/missing-origin-check) — the artifact's service worker now
  rejects cross-origin cache-control messages.
- PWA backend serving (#200), React login form end-to-end (#190),
  create/Add form completing CRUD (#199), autocomplete FK widget
  (#207), date_hierarchy drill-down (#205), action-label + list
  cosmetics fixes (#203/#204), lint cleanup (#202).

368 tests pass. Tier 6 — version bump; publish via the Security
deploy-gate under the standing "deploy regularly if secure" directive.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
MartinCastroAlvarez added a commit that referenced this pull request May 26, 2026
Ships the batch merged since 0.2.0a2:
- SECURITY: SW message-handler origin check (#208, CodeQL
  js/missing-origin-check) — the artifact's service worker now
  rejects cross-origin cache-control messages.
- PWA backend serving (#200), React login form end-to-end (#190),
  create/Add form completing CRUD (#199), autocomplete FK widget
  (#207), date_hierarchy drill-down (#205), action-label + list
  cosmetics fixes (#203/#204), lint cleanup (#202).

368 tests pass. Tier 6 — version bump; publish via the Security
deploy-gate under the standing "deploy regularly if secure" directive.

Co-authored-by: Martin Castro Laminrs <mcastro@laminr.ai>
Co-authored-by: Claude Opus 4.7 (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.

2 participants