lib/rubocop/comment_config.rb in rubocop-0.88.0 vs lib/rubocop/comment_config.rb in rubocop-0.89.0
- old
+ new
@@ -9,11 +9,11 @@
COP_NAME_PATTERN = '([A-Z]\w+/)?(?:[A-Z]\w+)'
COP_NAMES_PATTERN = "(?:#{COP_NAME_PATTERN} , )*#{COP_NAME_PATTERN}"
COPS_PATTERN = "(all|#{COP_NAMES_PATTERN})"
COMMENT_DIRECTIVE_REGEXP = Regexp.new(
- ('# rubocop : ((?:disable|enable|todo))\b ' + COPS_PATTERN)
+ "# rubocop : ((?:disable|enable|todo))\\b #{COPS_PATTERN}"
.gsub(' ', '\s*')
)
CopAnalysis = Struct.new(:line_ranges, :start_line_number)
@@ -53,10 +53,10 @@
end
extras
end
- def analyze
+ def analyze # rubocop:todo Metrics/AbcSize
analyses = Hash.new { |hash, key| hash[key] = CopAnalysis.new([], nil) }
each_mentioned_cop do |cop_name, disabled, line, single_line|
analyses[cop_name] =
analyze_cop(analyses[cop_name], disabled, line, single_line)