Add ContextCreatingMethods in order to prevent unexpected failures
Description
We noticed in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/11064#note_167154961 that rubocop fails with Lint/UselessAccessModifier
although the code seems ok. The problem is we have private
modifier in class_methods
and then use it again outside of the context. One example of what would be failing similar to our case:
module SomeModule
class_methods do
private
def some_method
end
end
private
def another_method
end
end
This problem was fixed on rubocop side but needs additional configuration (ContextCreatingMethods
) - see https://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Lint/UselessAccessModifier for more details.
This MR changes the configuration of the cop, so that the code in question does not fail anymore.