Skip to content

Instantly share code, notes, and snippets.

@dreikanter
Created November 16, 2019 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dreikanter/05e482bcb69dd57fd864bf3510da5652 to your computer and use it in GitHub Desktop.
Save dreikanter/05e482bcb69dd57fd864bf3510da5652 to your computer and use it in GitHub Desktop.
purge_rubocop_todo.rb
require 'yaml'
data = YAML.load_file('.rubocop_todo.yml')
data.each do |cop, options|
excludes = options['Exclude']
next unless excludes
next if excludes.empty?
data[cop]['Exclude'] = excludes.select do |path|
File.exist?(File.expand_path(path, __dir__))
end
end
File.open('.rubocop_todo_NEW.yml', 'wt') { |f| YAML.dump(data, f) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment