We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, Naming/FileName always flag the following code:
Naming/FileName
lib/something/bar.rb
module Something Bar = Struct.new(:bar) end
which produces
Offenses: lib/something/bar.rb:1:1: C: Naming/FileName: bar.rb should define a class or module called Something::Bar. module Something ^
It'd be great to support such constant assignments.
In this example, one could use class Bar < Struct.new(:bar) but those workarounds are not always feasible.
class Bar < Struct.new(:bar)
See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/73252#note_717026413
The text was updated successfully, but these errors were encountered:
Struct
ExpectMatchingDefinition
[Fix rubocop#10221] Update Naming::FileName to recognize Structs …
Naming::FileName
f9e46ef
…as classes that satisfy the `ExpectMatchingDefinition` requirement.
We might also want to support aliasing as in:
module Something Bar = ::OtherNamespace::Bar end
Sorry, something went wrong.
[Fix #10221] Update Naming::FileName to recognize Structs as clas…
1707630
…ses that satisfy the `ExpectMatchingDefinition` requirement.
Successfully merging a pull request may close this issue.
Is your feature request related to a problem? Please describe.
Currently,
Naming/FileName
always flag the following code:lib/something/bar.rb
which produces
Describe the solution you'd like
It'd be great to support such constant assignments.
Describe alternatives you've considered
In this example, one could use
class Bar < Struct.new(:bar)
but those workarounds are not always feasible.Additional context
See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/73252#note_717026413
The text was updated successfully, but these errors were encountered: