lib/rubocop/cop/cop.rb in rubocop-0.33.0 vs lib/rubocop/cop/cop.rb in rubocop-0.34.0

- old
+ new

@@ -196,10 +196,14 @@ def relevant_file?(file) file_name_matches_any?(file, 'Include', true) && !file_name_matches_any?(file, 'Exclude', false) end + def excluded_file?(file) + !relevant_file?(file) + end + def style_guide_url url = cop_config && cop_config['StyleGuide'] (url.nil? || url.empty?) ? nil : url end @@ -247,12 +251,12 @@ return unless severity if Severity::NAMES.include?(severity.to_sym) severity.to_sym else - warn("Warning: Invalid severity '#{severity}'. " + - "Valid severities are #{Severity::NAMES.join(', ')}." - .color(:red)) + message = "Warning: Invalid severity '#{severity}'. " \ + "Valid severities are #{Severity::NAMES.join(', ')}." + warn(Rainbow(message).red) end end end end end