Layout File Name Not in snake_case
ID |
kotlin.android_layout_file_name |
Severity |
info |
Remediation Complexity |
trivial |
Remediation Risk |
medium |
Remediation Effort |
low |
Resource |
Naming Convention |
Language |
Kotlin |
Tags |
android, naming |
Description
Reports Android layout XML files whose file name does not follow the snake_case.xml convention (lowercase letters, digits and underscores only).
Rationale
Android Studio, AAPT and many code generators (data-binding, view-binding) rely on the snake_case convention when deriving generated R-class identifiers and binding class names. Deviations cause inconsistent generated identifiers, break code review tooling that uses the file name as a heuristic, and stand out in mixed teams.
res/layout/MainActivity.xml <-- Bad (PascalCase)
res/layout/main-activity.xml <-- Bad (dash)
res/layout/mainActivity.xml <-- Bad (camelCase)
res/layout/main_activity.xml <-- Good