Skip to content

Commit

Permalink
Remove redundant todo. Not caught because it self excludes...
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre committed Jul 30, 2020
1 parent 242701f commit 1523e6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rubocop/cop/lint/redundant_cop_disable_directive.rb
Expand Up @@ -135,7 +135,7 @@ def each_already_disabled(line_ranges, disabled_ranges, comments)
end
end

# rubocop:todo Metrics/AbcSize, Metrics/CyclomaticComplexity
# rubocop:todo Metrics/CyclomaticComplexity
def find_redundant(comment, offenses, cop, line_range, next_line_range)
if all_disabled?(comment)
# If there's a disable all comment followed by a comment
Expand All @@ -153,7 +153,7 @@ def find_redundant(comment, offenses, cop, line_range, next_line_range)
cop if cop_offenses.none? { |o| line_range.cover?(o.line) }
end
end
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity
# rubocop:enable Metrics/CyclomaticComplexity

def all_disabled?(comment)
/rubocop\s*:\s*(?:disable|todo)\s+all\b/.match?(comment.text)
Expand Down

0 comments on commit 1523e6e

Please sign in to comment.