filename_case
Basename (stem only or full) matches a case convention: snake, kebab, pascal, camel, screaming-snake, flat, lower, upper.
Fix: file_rename — converts the stem to the configured case, preserving extension.
Options
Section titled “Options”| Option | Type | Required | Default | Description |
|---|---|---|---|---|
case | one of lower | lowercase | upper | uppercase | pascal | pascalcase | PascalCase | UpperCamelCase | upper_camel | upper_camel_case | camel | camelcase | camelCase | lowerCamelCase | lower_camel | lower_camel_case | snake | snakecase | snake_case | kebab | kebabcase | kebab-case | dash | dashcase | dash-case | screaming-snake | screamingsnake | screamingsnakecase | SCREAMING_SNAKE_CASE | upper_snake | upper_snake_case | flat | flatcase | yes |
Plus the common paths, level, id, and when fields. This table is generated from the JSON Schema; option types and defaults are authoritative.
Example
Section titled “Example”Rust source files whose names break the snake_case convention
Section titled “Rust source files whose names break the snake_case convention”The rule fires on this repository:
src/src/BadModule.rssrc/OtherName.rssrc/good_module.rsWith this .alint.yml:
version: 1rules: - id: rust-snake kind: filename_case paths: "src/**/*.rs" case: snake level: erroralint check reports:
--- src/BadModule.rs ----------------------------------------------------------- x error rust-snake filename stem "BadModule" is not snake_case
--- src/OtherName.rs ----------------------------------------------------------- x error rust-snake filename stem "OtherName" is not snake_case
Summary (2 violations): x 2 errors 0 passing * 1 failingEvery Rust source file name is snake_case
Section titled “Every Rust source file name is snake_case”This repository is compliant:
src/src/lib.rssrc/main.rssrc/nested_mod.rssrc/with1number.rsWith this .alint.yml:
version: 1rules: - id: rust-snake kind: filename_case paths: "src/**/*.rs" case: snake level: erroralint check reports:
v All 1 rule(s) passed.