You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…nition`
Fixesrubocop#9819.
This PR fixes a false negative for `Style/TopLevelMethodDefinition`
when defining a top-level method after a class definition.
See my gist for all relevant files and output.
Expected behavior
Style/TopLevelMethodDefinition
should detect top-level methods regardless of where they appear in a file, including after a class definition.Actual behavior
Describe here what actually happened.
Please use
rubocop --debug
when pasting rubocop output as it contains additional information.Steps to reproduce the problem
Turn on the
Style/TopLevelMethodDefinition
cop:Run rubocop against the following file:
The top-level method
one
will not get detected.Note that the cop works if the method is the only contents of the file:
RuboCop version
The text was updated successfully, but these errors were encountered: