file-name-matches-type
What it does
Section titled “What it does”Reports a file whose name, up to its first dot and ignoring case, is not the name of the first type in the file; a generic type may also be written Name{T,U}. Not checked when that type is partial. No fix.
Why it matters
Section titled “Why it matters”A file named after its type is found by the name from the file tree, from a stack trace and from a search. A file whose name says something else sends the reader to the wrong place.
To fix, rename the file or the type.
Example
Section titled “Example”class Orders { }Configuration
Section titled “Configuration”csharp: lint: rules: file-name-matches-type: warn # off (default), warn, errorEnabled by the presets: csharp/stylecop.
Suppress one line with sudsy-disable-next-line file-name-matches-type in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| StyleCop | SA1649 |
full |