Last active
April 22, 2021 09:26
-
-
Save ainame/710060e5387d62b5e64faecf4a5fee52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
cops = File.read('.rubocop_todo.yml') | |
.split("\n\n") | |
.drop(1) | |
.map { | |
{ | |
count: _1.match(/Offense count: (\d+)/).captures[0].to_i, | |
yaml: YAML.load(_1), | |
auto_correct: _1.match(/Cop supports --auto-correct/) != nil | |
} | |
} | |
# => {:count=>1, :yaml=>{"Style/TrailingCommaInHashLiteral"=>{"Enabled"=>false}}, :auto_correct=>true} | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment