Created
May 24, 2017 23:41
-
-
Save ipepe/f7b2623e1e3e8ee5fe8c56d368032a4e to your computer and use it in GitHub Desktop.
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 characters
| rules = { | |
| 'Layout/AndOr' => 'Style', | |
| 'Layout/BarePercentLiterals' => 'Style', | |
| 'Layout/BracesAroundHashParameters' => 'Style', | |
| 'Layout/ClassAndModuleChildren' => 'Style', | |
| 'Layout/ClassCheck' => 'Style', | |
| 'Layout/CollectionMethods' => 'Style', | |
| 'Layout/CommentAnnotation' => 'Style', | |
| 'Layout/Encoding' => 'Style', | |
| 'Layout/FileName' => 'Style', | |
| 'Layout/For' => 'Style', | |
| 'Layout/FormatString' => 'Style', | |
| 'Layout/GlobalVars' => 'Style', | |
| 'Layout/GuardClause' => 'Style', | |
| 'Layout/HashSyntax' => 'Style', | |
| 'Layout/IfUnlessModifier' => 'Style', | |
| 'Layout/LambdaCall' => 'Style', | |
| 'Layout/Next' => 'Style', | |
| 'Layout/NonNilCheck' => 'Style', | |
| 'Layout/MethodDefParentheses' => 'Style', | |
| 'Layout/MethodName' => 'Style', | |
| 'Layout/NumericLiterals' => 'Style', | |
| 'Layout/NumericPredicate' => 'Style', | |
| 'Layout/ParenthesesAroundCondition' => 'Style', | |
| 'Layout/PercentLiteralDelimiters' => 'Style', | |
| 'Layout/PercentQLiterals' => 'Style', | |
| 'Layout/PredicateName' => 'Style', | |
| 'Layout/RaiseArgs' => 'Style', | |
| 'Layout/RedundantReturn' => 'Style', | |
| 'Layout/RegexpLiteral' => 'Style', | |
| 'Layout/Semicolon' => 'Style', | |
| 'Layout/SignalException' => 'Style', | |
| 'Layout/SingleLineBlockParams' => 'Style', | |
| 'Layout/SingleLineMethods' => 'Style', | |
| 'Layout/StringLiteralsInInterpolation' => 'Style', | |
| 'Layout/SymbolProc' => 'Style', | |
| 'Layout/TrailingCommaInLiteral' => 'Style', | |
| 'Layout/TrailingCommaInArguments' => 'Style', | |
| 'Layout/TrivialAccessors' => 'Style', | |
| 'Layout/VariableName' => 'Style', | |
| 'Layout/WhileUntilModifier' => 'Style', | |
| 'Layout/WordArray' => 'Style', | |
| 'Layout/InlineComment' => 'Style', | |
| 'Layout/MethodCalledOnDoEndBlock' => 'Style', | |
| 'Layout/SymbolArray' => 'Style', | |
| 'Layout/AccessorMethodName' => 'Style', | |
| 'Layout/Alias' => 'Style', | |
| 'Layout/ArrayJoin' => 'Style', | |
| 'Layout/AsciiComments' => 'Style', | |
| 'Layout/AsciiIdentifiers' => 'Style', | |
| 'Layout/Attr' => 'Style', | |
| 'Layout/BeginBlock' => 'Style', | |
| 'Layout/BlockComments' => 'Style', | |
| 'Layout/BlockDelimiters' => 'Style', | |
| 'Layout/CaseEquality' => 'Style', | |
| 'Layout/CharacterLiteral' => 'Style', | |
| 'Layout/ClassAndModuleCamelCase' => 'Style', | |
| 'Layout/ClassMethods' => 'Style', | |
| 'Layout/ClassVars' => 'Style', | |
| 'Layout/ColonMethodCall' => 'Style', | |
| 'Layout/ConstantName' => 'Style', | |
| 'Layout/DefWithParentheses' => 'Style', | |
| 'Layout/PreferredHashMethods' => 'Style', | |
| 'Layout/Documentation' => 'Style', | |
| 'Layout/DoubleNegation' => 'Style', | |
| 'Layout/EachWithObject' => 'Style', | |
| 'Layout/EmptyElse' => 'Style', | |
| 'Layout/EmptyLiteral' => 'Style', | |
| 'Layout/EndBlock' => 'Style', | |
| 'Layout/EvenOdd' => 'Style', | |
| 'Layout/FlipFlop' => 'Style', | |
| 'Layout/IfWithSemicolon' => 'Style', | |
| 'Layout/InfiniteLoop' => 'Style', | |
| 'Layout/Lambda' => 'Style', | |
| 'Layout/LineEndConcatenation' => 'Style', | |
| 'Layout/MethodCallWithoutArgsParentheses' => 'Style', | |
| 'Layout/ModuleFunction' => 'Style', | |
| 'Layout/MultilineIfThen' => 'Style', | |
| 'Layout/MultilineTernaryOperator' => 'Style', | |
| 'Layout/NegatedIf' => 'Style', | |
| 'Layout/NegatedWhile' => 'Style', | |
| 'Layout/NestedTernaryOperator' => 'Style', | |
| 'Layout/NilComparison' => 'Style', | |
| 'Layout/Not' => 'Style', | |
| 'Layout/OneLineConditional' => 'Style', | |
| 'Layout/OpMethod' => 'Style', | |
| 'Layout/PerlBackrefs' => 'Style', | |
| 'Layout/Proc' => 'Style', | |
| 'Layout/RedundantBegin' => 'Style', | |
| 'Layout/RedundantException' => 'Style', | |
| 'Layout/RescueModifier' => 'Style', | |
| 'Layout/SelfAssignment' => 'Style', | |
| 'Layout/SpecialGlobalVars' => 'Style', | |
| 'Layout/StructInheritance' => 'Style', | |
| 'Layout/UnlessElse' => 'Style', | |
| 'Layout/UnneededCapitalW' => 'Style', | |
| 'Layout/UnneededPercentQ' => 'Style', | |
| 'Layout/CommandLiteral' => 'Style', | |
| 'Layout/VariableInterpolation' => 'Style', | |
| 'Layout/WhenThen' => 'Style', | |
| 'Layout/WhileUntilDo' => 'Style', | |
| 'Lint/Eval' => 'Security', | |
| 'Lint/SpaceBeforeFirstArg' => 'Layout', | |
| 'Layout/FrozenStringLiteralComment' => 'Style' | |
| } | |
| require 'pry' | |
| require 'yaml' | |
| rubocop_file = YAML.load_file('.rubocop.yml') | |
| rules.each do |rule, new| | |
| new_rule = rule.split('/').first + '/' + new | |
| rubocop_file[new_rule] = rubocop_file.delete(rule) | |
| end | |
| puts rubocop_file.to_yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment