configs/rubocop/gds-ruby-styleguide.yml in govuk-lint-4.0.0 vs configs/rubocop/gds-ruby-styleguide.yml in govuk-lint-4.0.1

- old
+ new

@@ -1,14 +1,14 @@ ############ ## General ############ -BlockAlignment: +Layout/BlockAlignment: Description: 'Align block ends correctly.' Enabled: true -CaseIndentation: +Layout/CaseIndentation: Description: Indentation of when in a case/when/[else/]end. Enabled: true EnforcedStyle: case SupportedStyles: - case @@ -21,231 +21,227 @@ Style/MutableConstant: Description: 'Freeze mutable objects assigned to constants.' Enabled: true -ElseLayout: +Lint/ElseLayout: Description: 'Check for odd code arrangement in an else block.' Enabled: true # Supports --auto-correct -EmptyLineBetweenDefs: +Layout/EmptyLineBetweenDefs: Description: Use empty lines between defs. Enabled: true AllowAdjacentOneLineDefs: false -EmptyLines: +Layout/EmptyLines: Description: "Don't use several empty lines in a row." Enabled: true -EndAlignment: +Layout/EndAlignment: Description: 'Align ends correctly.' Enabled: true -EndOfLine: +Layout/EndOfLine: Description: 'Use Unix-style line endings.' Enabled: true # Supports --auto-correct -IndentationWidth: +Layout/IndentationWidth: Description: Use 2 spaces for indentation. Enabled: true # Supports --auto-correct -IndentationConsistency: +Layout/IndentationConsistency: Description: Keep indentation straight. Enabled: true -LineLength: +Metrics/LineLength: Description: Limit lines to 80 characters. Enabled: false Max: 80 -# Supports --auto-correct -SpaceAroundOperators: + # Supports --auto-correct +Layout/SpaceAroundOperators: Description: Use spaces around operators. Enabled: true # Supports --auto-correct -SpaceBeforeBlockBraces: +Layout/SpaceBeforeBlockBraces: Description: Checks that the left block brace has or doesn't have space before it. Enabled: true EnforcedStyle: space SupportedStyles: - space - no_space # Supports --auto-correct -SpaceAfterSemicolon: +Layout/SpaceAfterSemicolon: Description: Use spaces after semicolons. Enabled: true # Supports --auto-correct -SpaceAfterColon: +Layout/SpaceAfterColon: Description: Use spaces after colons. Enabled: true # Supports --auto-correct -SpaceAfterComma: +Layout/SpaceAfterComma: Description: Use spaces after commas. Enabled: true # Supports --auto-correct -SpaceInsideReferenceBrackets: +Layout/SpaceInsideReferenceBrackets: Description: No spaces after array[ or before ]. Enabled: true # Supports --auto-correct -SpaceInsideArrayLiteralBrackets: +Layout/SpaceInsideArrayLiteralBrackets: Description: No spaces after array = [ or before ]. Enabled: true # Supports --auto-correct -SpaceInsideParens: +Layout/SpaceInsideParens: Description: No spaces after ( or before ). Enabled: true -Tab: +Layout/Tab: Description: No hard tabs. Enabled: true # Supports --auto-correct -TrailingWhitespace: +Layout/TrailingWhitespace: Description: Avoid trailing whitespace. Enabled: true # Supports --auto-correct -TrailingBlankLines: +Layout/TrailingBlankLines: Description: Checks trailing blank lines and final newline. Enabled: true EnforcedStyle: final_newline SupportedStyles: - final_newline - final_blank_line ## Syntax # Supports --auto-correct -AndOr: +Style/AndOr: Description: Use &&/|| instead of and/or. Enabled: true # Supports --auto-correct -DefWithParentheses: +Style/DefWithParentheses: Description: Use def with parentheses when there are arguments. Enabled: true -For: +Style/For: Description: Checks use of for or each in multiline loops. Enabled: true EnforcedStyle: each SupportedStyles: - for - each -IfUnlessModifier: +Style/IfUnlessModifier: Description: Favor modifier if/unless usage when you have a single-line body. Enabled: false -Metrics: - LineLength: - Max: 80 - -MethodCalledOnDoEndBlock: +Style/MethodCalledOnDoEndBlock: Description: Avoid chaining a method call on a do...end block. Enabled: true -MethodCallWithoutArgsParentheses: +Style/MethodCallWithoutArgsParentheses: Description: 'Do not use parentheses for method calls with no arguments.' Enabled: true -MultilineBlockChain: +Style/MultilineBlockChain: Description: Avoid multi-line chains of blocks. Enabled: true -MultilineIfThen: +Style/MultilineIfThen: Description: Never use then for multi-line if/unless. Enabled: true -MultilineTernaryOperator: +Style/MultilineTernaryOperator: Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.' Enabled: true -NestedTernaryOperator: +Style/NestedTernaryOperator: Description: Use one expression per branch in a ternary operator. Enabled: true -OneLineConditional: +Style/OneLineConditional: Description: Favor the ternary operator(?:) over if/then/else/end constructs. Enabled: true # Supports --auto-correct -ParenthesesAroundCondition: +Style/ParenthesesAroundCondition: Description: Don't use parentheses around the condition of an if/unless/while. Enabled: true AllowSafeAssignment: true # Supports --auto-correct -RedundantReturn: +Style/RedundantReturn: Description: Don't use return where it's not required. Enabled: true AllowMultipleReturnValues: false # Supports --auto-correct -SpaceAfterMethodName: +Layout/SpaceAfterMethodName: Description: Never put a space between a method name and the opening parenthesis in a method definition. Enabled: true # Supports --auto-correct -SpaceAroundEqualsInParameterDefault: +Layout/SpaceAroundEqualsInParameterDefault: Description: Checks that the equals signs in parameter default assignments have or don't have surrounding space depending on configuration. Enabled: true EnforcedStyle: space SupportedStyles: - space - no_space -UnlessElse: +Style/UnlessElse: Description: Never use unless with else. Rewrite these with the positive case first. Enabled: true # Supports --auto-correct -UnusedBlockArgument: +Lint/UnusedBlockArgument: Description: Checks for unused block arguments. Enabled: true ## Naming -ClassAndModuleCamelCase: +Naming/ClassAndModuleCamelCase: Description: Use CamelCase for classes and modules. Enabled: true # Supports --auto-correct -ClassMethods: +Style/ClassMethods: Description: Use self when defining module/class methods. Enabled: true -ClassVars: +Style/ClassVars: Description: Avoid the use of class variables. Enabled: true -ConstantName: +Naming/ConstantName: Description: Constants should use SCREAMING_SNAKE_CASE. Enabled: true -MethodName: +Naming/MethodName: Description: Use the configured style when naming methods. Enabled: true EnforcedStyle: snake_case SupportedStyles: - snake_case - camelCase # Supports --auto-correct -TrivialAccessors: +Style/TrivialAccessors: Description: Prefer attr_* methods to trivial readers/writers. Enabled: true ExactNameMatch: true AllowPredicates: true AllowDSLWriters: false @@ -266,34 +262,34 @@ - to_regexp - to_str - to_s - to_sym -VariableName: +Naming/VariableName: Description: Use the configured style when naming variables. Enabled: true EnforcedStyle: snake_case SupportedStyles: - snake_case - camelCase ## Exceptions # Supports --auto-correct -RescueException: +Lint/RescueException: Description: Avoid rescuing the Exception class. Enabled: true ## Collections # Supports --auto-correct -AlignArray: +Layout/AlignArray: Description: Align the elements of an array literal if they span more than one line. Enabled: true # Supports --auto-correct -HashSyntax: +Style/HashSyntax: Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a => 1, :b => 2 }.' Enabled: true Exclude: - 'db/schema.rb' @@ -301,39 +297,39 @@ EnforcedStyle: ruby19 SupportedStyles: - ruby19 - hash_rockets -TrailingCommaInArrayLiteral: +Style/TrailingCommaInArrayLiteral: Enabled: true EnforcedStyleForMultiline: comma -TrailingCommaInHashLiteral: +Style/TrailingCommaInHashLiteral: Enabled: true EnforcedStyleForMultiline: comma -TrailingCommaInArguments: +Style/TrailingCommaInArguments: Enabled: true EnforcedStyleForMultiline: comma # Supports --auto-correct -WordArray: +Style/WordArray: Description: Use %w or %W for arrays of words. Enabled: true MinSize: 0 -MultilineMethodCallIndentation: +Layout/MultilineMethodCallIndentation: Enabled: false ## Strings # Supports --auto-correct -StringConversionInInterpolation: +Lint/StringConversionInInterpolation: Description: Checks for Object#to_s usage in string interpolation. Enabled: true # Supports --auto-correct -StringLiterals: +Style/StringLiterals: Description: Checks if uses of quotes match the configured preference. Enabled: true EnforcedStyle: double_quotes SupportedStyles: - single_quotes