Skip to content

chore: code-quality audit fixes (#651–#656)#660

Merged
MartinCastroAlvarez merged 5 commits into
mainfrom
chore/code-quality-audit-651-656
Jun 1, 2026
Merged

chore: code-quality audit fixes (#651–#656)#660
MartinCastroAlvarez merged 5 commits into
mainfrom
chore/code-quality-audit-651-656

Conversation

@MartinCastroAlvarez
Copy link
Copy Markdown
Owner

Summary

Code-quality audit fixes from the Python + frontend audits. Addresses #651#656; #657 (DetailPage/ListPage split) is deferred and not touched. No PyPI version bump, no release.

Per-fix

Verification (all green)

Python: ruff check ✓, ruff format --check (27 files) ✓, mypy django_admin_react ✓, bandit -r django_admin_react -c pyproject.toml (0 issues) ✓, pytest ✓ (66 passed). pre-commit run ✓ on all changed in-scope files.

Frontend: pnpm lint:js ✓, pnpm lint:css ✓, pnpm typecheck ✓ (all 13 projects).

Decisions

  • mypy strictness: enabled the disallow_untyped_defs + warn_return_any subset rather than full strict = true — full strict would also require typing the test suite (gaps tracked in Type-hint coverage: 3 package gaps + 139 untyped defs in tests/ + enable an ANN/strict-defs gate #318). The package passes the subset cleanly today.
  • no-explicit-any: flipping to error surfaced zero violations.
  • AdminSite import is TYPE_CHECKING-only so the runtime "admin removed from INSTALLED_APPS" path is preserved.
  • Untracked examples/*/migrations/0001_initial.py and pre-existing examples/ lint debt were intentionally left untouched / uncommitted.

Closes #651
Closes #652
Closes #653
Closes #654
Closes #655
Closes #656

🤖 Generated with Claude Code

martin-castro-laminr-ai and others added 5 commits June 1, 2026 20:07
)

Remove Black, standalone isort, and flake8 entirely — their config
blocks, dev dependencies, and scripts/lint.sh steps. Ruff now owns lint
+ format + import order (the `I` rules); mypy and bandit run alongside.
This resolves the three-formatter conflict and the Black 24-vs-26 pin
skew (#452).

Enable a strict mypy subset on the package (disallow_untyped_defs,
warn_return_any) and wire the now-green Python lint gate (ruff check +
ruff format --check + mypy + bandit) into backend CI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Remove the misleading "Real implementation lands in PR #2" note on the
  shipped _PackageSettings dataclass and a dead `# noqa: ARG002` line in
  views.py that suppressed nothing (#654). (audit.py dead-code removal
  landed in the preceding lint-stack commit.)
- Type the admin_site view helpers as AdminSite (type-only import, so the
  package still works with django.contrib.admin removed) and add the
  missing `from typing import Any` to tests/test_spa_index.py (F821) (#655).
- Normalize residual lint debt (import order + slice/assert formatting)
  across tests and templatetags now that the gate is green (#651).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Repoint or remove docstring / comment / pre-commit citations to docs that
no longer exist (docs/ux/pwa.md, pwa.md, theming.md, ACCEPTANCE.md,
REVIEW_CHECKLIST.md, docs/threat-model.md) so they target the surviving
ARCHITECTURE.md / SECURITY.md sections. (conf.py's docs/ux/pwa.md cites
were fixed alongside the comment cleanup in the preceding commit.)

Add tests/test_doc_refs.py plus a pre-commit hook that fails when a *.md
file or §N section cited in the package source, tests, or
.pre-commit-config.yaml no longer exists, so this defect class can't
recur. Also drop the black + isort pre-commit hooks per #651/#652.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Flip @typescript-eslint/no-explicit-any from 'off' to 'error' to lock
  in the existing zero-`any` state; no violations surfaced.
- Remove the stale .eslintrc.cjs entry from the flat-config ignores.
- Add /** JSDoc to the Checkbox, Input, Spinner, EmptyState, and
  DateHierarchyBar primitives for doc consistency.

Verified: pnpm lint:js, pnpm lint:css, pnpm typecheck all pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
#656)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@MartinCastroAlvarez MartinCastroAlvarez merged commit 536d3a6 into main Jun 1, 2026
6 checks passed
@MartinCastroAlvarez MartinCastroAlvarez deleted the chore/code-quality-audit-651-656 branch June 1, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment