Sha256: 90c3d60a2a2d3cc76deb39351af7c37ceece4f145349bec365e9c08477ec9fe6
Contents?: true
Size: 1.05 KB
Versions: 8
Compression:
Stored size: 1.05 KB
Contents
# encoding: utf-8 module Rubocop module Formatter # This formatter displays a YAML configuration file where all cops that # detected any offences are disabled. class DisabledConfigFormatter < BaseFormatter HEADING = ['# This configuration was generated by `rubocop --auto-gen-config`.', '# The point is for the user to remove these configuration records', '# one by one as the offences are removed from the code base.'] .join("\n") def file_finished(file, offences) @cops_with_offences ||= {} offences.each { |o| @cops_with_offences[o.cop_name] = true } end def finished(inspected_files) output.puts HEADING @cops_with_offences.keys.sort.each do |cop_name| output.puts output.puts "#{cop_name}:" output.puts ' Enabled: false' end puts "Created #{output.path}." puts "Run rubocop with --config #{output.path}, or" puts "add inherit_from: #{output.path} in a .rubocop.yml file." end end end end
Version data entries
8 entries across 8 versions & 1 rubygems