Rubocop: Ignore `rubocop:disable` comments at the end of long lines

Created on 28 Sep 2016  路  1Comment  路  Source: rubocop-hq/rubocop

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: https://github.com/bbatsov/rubocop/issues/3479.

Thanks :)

enhancement hacktoberfest

Most helpful comment

:wave:

>All comments

:wave:

Was this page helpful?
0 / 5 - 0 ratings