File name matches type (ARCH6005)
Key ruby.naming.file-name-matches-type · Severity info · Category naming
When a file’s name does not match its primary type, the code becomes harder to navigate. In Ruby a UserAccount class belongs in user_account.rb, the snake_case form of the type. The rule is off for languages where multi-type files are idiomatic.
Incorrect
Section titled “Incorrect”class UserAccount def initialize(name) @name = name endendCorrect
Section titled “Correct”class UserAccount def initialize(name) @name = name endendRename the file to the snake_case form of its primary type (UserAccount → user_account.rb).