.rubocop.yml in ginny-0.5.0 vs .rubocop.yml in ginny-0.5.2

- old
+ new

@@ -9,130 +9,167 @@ Style/DocumentationMethod: Enabled: true Exclude: - 'test/**/*.rb' -Layout/EmptyLinesAroundClassBody: +Style/SingleLineMethods: Exclude: - 'test/**/*.rb' # Don't leave calls to pry lying around. Lint/Debugger: Enabled: true +# ============================================================================== +# Layout +# ============================================================================== + Metrics/LineLength: Max: 150 -Style/StringLiterals: - EnforcedStyle: double_quotes +Layout/EmptyLineAfterGuardClause: + Enabled: false -Style/FrozenStringLiteralComment: +Layout/EmptyLinesAroundModuleBody: Enabled: false -Naming/HeredocDelimiterNaming: +Layout/EmptyLinesAroundClassBody: Enabled: false -# Only use braces if the function expects a hash argument. [different in Ruby 2.7+](https://blog.saeloun.com/2019/10/07/ruby-2-7-keyword-arguments-redesign.html) -Style/BracesAroundHashParameters: +Layout/EmptyLinesAroundBlockBody: Enabled: false -Layout/IndentFirstHashElement: - EnforcedStyle: consistent - -Layout/IndentFirstArrayElement: - EnforcedStyle: consistent - # https://unix.stackexchange.com/a/18789 Layout/TrailingBlankLines: EnforcedStyle: final_newline -Style/TrailingCommaInArguments: - EnforcedStyleForMultiline: comma +# ============================================================================== +# Strings +# ============================================================================== -Style/TrailingCommaInArrayLiteral: - EnforcedStyleForMultiline: comma +Style/StringLiterals: + EnforcedStyle: double_quotes -Style/TrailingCommaInHashLiteral: - EnforcedStyleForMultiline: comma +Style/FrozenStringLiteralComment: + Enabled: false -Layout/EmptyLineAfterGuardClause: +Naming/HeredocDelimiterNaming: Enabled: false -Style/DefWithParentheses: +# ============================================================================== +# Numbers +# ============================================================================== + +Style/ZeroLengthPredicate: Enabled: false -Style/MethodCallWithoutArgsParentheses: +Style/NumericPredicate: Enabled: false -# Explicit, not redundant -Style/RedundantReturn: +Naming/VariableNumber: + EnforcedStyle: snake_case + +# ============================================================================== +# Braces, Brackets, & Parens +# ============================================================================== + +Style/DefWithParentheses: Enabled: false -# Explicit, not redundant -Style/RedundantSelf: +Style/MethodCallWithoutArgsParentheses: Enabled: false -# Use of `&` with bracket access isn't what I'd call "readable". -Style/SafeNavigation: +# Only use braces if the function expects a hash argument. [different in Ruby 2.7+](https://blog.saeloun.com/2019/10/07/ruby-2-7-keyword-arguments-redesign.html) +Style/BracesAroundHashParameters: Enabled: false Style/WordArray: EnforcedStyle: brackets Style/SymbolArray: EnforcedStyle: brackets -# TODO: File issue to ignore enums when using `EnforcedStyle: assign_inside_condition`. -Style/ConditionalAssignment: - # EnforcedStyle: assign_inside_condition - # EnforcedStyle: assign_to_condition - Enabled: false +# ============================================================================== +# Trailing Commas +# ============================================================================== -Lint/HandleExceptions: - AllowComments: true +Style/TrailingCommaInArguments: + EnforcedStyleForMultiline: comma -# Lint/UnneededCopDisableDirective: -# Enabled: false +Style/TrailingCommaInArrayLiteral: + EnforcedStyleForMultiline: comma -Metrics/BlockLength: +Style/TrailingCommaInHashLiteral: + EnforcedStyleForMultiline: comma + +# ============================================================================== +# Fewer lines doesn't mean better code +# ============================================================================== + +Metrics/ModuleLength: Enabled: false Metrics/ClassLength: Enabled: false -Metrics/ModuleLength: +Metrics/MethodLength: Enabled: false -Metrics/MethodLength: +Metrics/BlockLength: Enabled: false -Metrics/AbcSize: +# ============================================================================== +# Names +# ============================================================================== + +# Everything else is snake case, numbers should be too. +Naming/VariableNumber: + EnforcedStyle: snake_case + +# ============================================================================== +# Unsorted +# ============================================================================== + +# Default value (special_inside_parentheses) is ridiculous. +# Look for yourself: https://www.rubydoc.info/gems/rubocop/0.69.0/RuboCop/Cop/Layout/IndentFirstHashElement +Layout/IndentFirstHashElement: + EnforcedStyle: consistent + +# Default value (special_inside_parentheses) is ridiculous. +# Look for yourself: https://www.rubydoc.info/gems/rubocop/0.69.0/RuboCop/Cop/Layout/IndentFirstArrayElement +Layout/IndentFirstArrayElement: + EnforcedStyle: consistent + +Layout/AlignHash: Enabled: false -Metrics/CyclomaticComplexity: +# Explicit, not redundant +Style/RedundantReturn: Enabled: false -Metrics/PerceivedComplexity: +# Explicit, not redundant +Style/RedundantSelf: Enabled: false -Layout/EmptyLinesAroundBlockBody: +# `x&.y&.[](:argument)` isn't what I'd call "readable". +# https://stackoverflow.com/questions/34794697/using-with-the-safe-navigation-operator-in-ruby +Style/SafeNavigation: Enabled: false -Layout/EmptyLinesAroundBlockBody: +# TODO: File issue to ignore enums when using `EnforcedStyle: assign_inside_condition`. +Style/ConditionalAssignment: Enabled: false -Layout/EmptyLinesAroundBlockBody: +Lint/HandleExceptions: + AllowComments: true + +Metrics/AbcSize: Enabled: false -Style/ZeroLengthPredicate: +Metrics/CyclomaticComplexity: Enabled: false -Style/NumericPredicate: +Metrics/PerceivedComplexity: Enabled: false Style/CommentedKeyword: Enabled: False - -Naming/VariableNumber: - EnforcedStyle: snake_case - -# [1]: https://medium.com/@nikgraf/why-you-should-enforce-dangling-commas-for-multiline-statements-d034c98e36f8