Skip to content
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

Ignore rubocop:disable comments at the end of long lines #3542

Closed
twe4ked opened this issue Sep 27, 2016 · 1 comment
Closed

Ignore rubocop:disable comments at the end of long lines #3542

twe4ked opened this issue Sep 27, 2016 · 1 comment

Comments

@twe4ked
Copy link
Contributor

twe4ked commented Sep 27, 2016

For example, given we have a max line length of 80:

#                                                                            vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
def method_definition_that_is_just_under_the_line_length_limit(foo, bar, baz) # rubocop:disable Metrics/AbcSize
  # The method body is too complicated and fails the ABC complexity cop
end

The rubocop:disable comment pushes the line length over the limit. I'd like an option to ignore counting the disable comment in the length of the line.

This could also be solved with an ignore pattern as described here: #3479.

Thanks :)

jmks added a commit to jmks/rubocop that referenced this issue Oct 11, 2016
The IgnoreCopDirectives option of Metrics/LineLength ignores directives like
'# rubocop:disable ...' when calculating the line's length.
bbatsov pushed a commit that referenced this issue Oct 11, 2016
The IgnoreCopDirectives option of Metrics/LineLength ignores directives like
'# rubocop:disable ...' when calculating the line's length.
Neodelf pushed a commit to Neodelf/rubocop that referenced this issue Oct 15, 2016
The IgnoreCopDirectives option of Metrics/LineLength ignores directives like
'# rubocop:disable ...' when calculating the line's length.
@smlparry
Copy link

smlparry commented May 9, 2017

👋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants