Last active
April 22, 2021 09:26
Revisions
-
ainame revised this gist
Apr 22, 2021 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ require 'yaml' cops = File.read('.rubocop_todo.yml') .split("\n\n") .drop(1) -
ainame created this gist
Apr 22, 2021 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ 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} # ...