Skip to content

chore(dev): Enforce frontend filename casing in pre-commit#120081

Closed
sentry-junior[bot] wants to merge 1 commit into
masterfrom
chore/prevent-case-only-rename
Closed

chore(dev): Enforce frontend filename casing in pre-commit#120081
sentry-junior[bot] wants to merge 1 commit into
masterfrom
chore/prevent-case-only-rename

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Block case-only renames and require new frontend modules to be named correctly up front.

Case-only renames break macOS case-insensitive checkouts when casing drifts across branches. check-case-conflict only catches two distinct colliding paths, not a single-file rename. Filename/export mismatches (metricHeatmapApiOptions vs metricHeatMapApiOptions) are what create the need for those renames.

Checks (tools/check_frontend_filenames.py)

  • Reject staged case-only renames (Foo.tsxfoo.tsx)
  • For newly added frontend files under static/ / tests/js/:
    • require camelCase filenames
    • if a primary export matches the stem case-insensitively, require the stem to match that export (PascalCase → camelCase, including leading acronyms like HTTPSnippethttpSnippet)

Existing mismatched files are left alone; only new adds / real renames are gated.

Case-only renames (Foo.tsx -> foo.tsx) break macOS case-insensitive
checkouts when casing drifts across branches. check-case-conflict only
catches two distinct colliding paths, not a single-file rename.

Co-Authored-By: Markus Unterwaditzer <markus@sentry.io>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 20, 2026
@sentry-junior sentry-junior Bot changed the title chore(dev): Prevent case-only file renames in pre-commit chore(dev): Enforce frontend filename casing in pre-commit Jul 20, 2026
@sentry-junior
sentry-junior Bot force-pushed the chore/prevent-case-only-rename branch from 76a18f8 to 60610d5 Compare July 20, 2026 17:46
@ryan953

ryan953 commented Jul 20, 2026

Copy link
Copy Markdown
Member

replaced by #120103

@ryan953 ryan953 closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant