Skip to content

chore: remove comments and improve readability across web and backend#243

Merged
felixevers merged 1 commit into
mainfrom
claude/determined-ride-FTD2k
Jun 4, 2026
Merged

chore: remove comments and improve readability across web and backend#243
felixevers merged 1 commit into
mainfrom
claude/determined-ride-FTD2k

Conversation

@felixevers
Copy link
Copy Markdown
Member

What

Code cleanup across the frontend (web/) and backend (backend/), following the project's self-documenting-code convention (AGENTS.md §10: "write self-explanatory code", no comments).

Comment removal

  • Removed explanatory comments from frontend (.ts, .tsx, .css) and backend (.py) source.
  • Preserved functional directives — flake8 # noqa: F401 re-export suppressions, and eslint-disable directives inside generated files.
  • Left generated artifacts untouched (web/api/gql/generated.ts, web/i18n/translations.ts, next-env.d.ts, DB migrations).

Readability / lint-safety

  • Replaced comment-only empty catch blocks with explicit no-ops so they remain lint-clean (the no-empty rule requires a non-empty body).
  • Rewrote the post-mutation entity reload (reloadEntityAfterMutation) from a try/catch/finally that depended on a comment into an equivalent promise chain. Behavior is unchanged and covered by the existing handler tests.

Tests added (coverage)

  • Backend unit tests:
    • normalize_datetime_to_utc (naive / UTC-aware / offset / None).
    • LocationValidator kind checks (validate_kind, validate_position_kind, validate_team_kind).
    • Task-graph helpers: more validate_task_graph_dict edge cases + graph_dict_from_preset_inputs.
  • Frontend unit tests:
    • viewDefinition helpers (filter/sort serialization round-trips, visibility/order baseline comparisons, parseViewParameters).
    • getPropertyFilterFn field-type → data-type mapping.
    • buildSurveyUrl anonymized (hashed) user-id query param.
  • E2E: a resilient smoke spec (document shell, mobile viewport, core entity routes).

Validation

All run locally against Postgres + Redis matching the CI services:

  • Backend: flake8 clean; pytest tests/unit tests/integration72 passed (was 48).
  • Frontend: tsc --noEmit && eslint . clean; vitest run55 passed (was 23); check-translations clean.

No behavior changes intended; no generated files edited by hand.


Generated by Claude Code

Strip explanatory comments from the frontend and backend per the
project's self-documenting code convention, while preserving functional
directives (flake8 noqa, eslint-disable in generated files) and leaving
generated artifacts untouched.

Readability and lint-safety:
- Replace comment-only empty catch blocks with explicit no-ops so they
  stay lint-clean without narration.
- Rewrite the post-mutation entity reload as a promise chain instead of
  a try/catch/finally that relied on a comment.

Tests:
- Backend: add unit coverage for the datetime normalizer, the location
  kind validators, and the task-graph preset/validation helpers.
- Frontend: add unit coverage for saved-view definition helpers, the
  property filter-type mapping, and the anonymized survey URL builder.
- E2E: add a resilient smoke spec for the document shell, mobile
  viewport, and core entity routes.
@felixevers felixevers merged commit c2b4c12 into main Jun 4, 2026
18 checks passed
@felixevers felixevers deleted the claude/determined-ride-FTD2k branch June 4, 2026 19:07
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