-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
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
Allow module in Metrics/BlockLength ExcludedMethods directive #4257
Labels
Comments
+1 |
Ref #4967 |
akhramov
pushed a commit
to akhramov/rubocop
that referenced
this issue
Apr 14, 2018
…thods` Currently `Metrics/BlockLength` cop has `ExcludedMethods` configuration option, which only allows to specify method names, without a module, i.e. the following works: ```yaml Metrics/BlockLength: ExcludedMethods: ['new'] ``` But the following doesn't: ```yaml Metrics/BlockLength: ExcludedMethods: ['Gem::Specification.new'] ``` This change tweaks `Cop::Metrics::BlockLength#on_block` so it looks not on the method being called, but rather on the whole `SendNode`. This preserves current behavior, but also lets specifying more interesting constructs like `Gem::Specification.new` or even method chains (`foo.bar.baz`).
akhramov
pushed a commit
to akhramov/rubocop
that referenced
this issue
Apr 14, 2018
…thods` This change addresses PR (rubocop#5544) comments
bbatsov
added a commit
to akhramov/rubocop
that referenced
this issue
Apr 15, 2018
…hod-chains-in-excluded-modules-directive
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My rubocop.yml:
But when I run rubocop, it still trips on:
Using rubocop 0.48.1
It does work when I switch to:
But that's less tightly scoped than I'd prefer.
The text was updated successfully, but these errors were encountered: