From bf6c3ea939c4890faa537745af564899e7795fa9 Mon Sep 17 00:00:00 2001 From: Piotr Murach Date: Sun, 12 Nov 2023 21:07:36 +0000 Subject: [PATCH] Add layout, metrics, naming and style rules to the rubocop configuration --- .rubocop.yml | 67 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 23 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 6eb8d4f..876f687 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,55 +2,76 @@ AllCops: NewCops: enable TargetRubyVersion: 2.0 +Gemspec/DevelopmentDependencies: + Enabled: false + +Layout/FirstArrayElementIndentation: + EnforcedStyle: consistent + +Layout/FirstHashElementIndentation: + EnforcedStyle: consistent + Layout/LineLength: Max: 80 +Layout/SpaceInsideHashLiteralBraces: + EnforcedStyle: no_space + Lint/AssignmentInCondition: Enabled: false Metrics/AbcSize: - Max: 35 + AllowedMethods: + - split_into_words Metrics/BlockLength: - CountComments: true - Max: 32 - IgnoredMethods: [] Exclude: - - "spec/**/*" + - "**/spec/**/*" + - "**/*.gemspec" Metrics/ClassLength: - Max: 1500 + Max: 150 Metrics/CyclomaticComplexity: - Enabled: false + AllowedMethods: + - split_into_words Metrics/MethodLength: - Max: 20 + AllowedMethods: + - split_into_words -Naming/BinaryOperatorParameterName: - Enabled: false +Metrics/PerceivedComplexity: + Max: 5 + AllowedMethods: + - split_into_words -Style/AccessorGrouping: - Enabled: false +Naming/FileName: + Exclude: + - "lib/strings-case.rb" + +Style/BlockDelimiters: + AllowedMethods: + - expect + - let -Style/AsciiComments: +Style/CommentedKeyword: Enabled: false -Style/LambdaCall: - EnforcedStyle: braces +Style/FetchEnvVar: + AllowedVars: + - COVERAGE Style/FormatString: EnforcedStyle: percent -Style/StringLiterals: - EnforcedStyle: double_quotes - -Style/TrivialAccessors: +Style/NegatedWhile: Enabled: false -# { ... } for multi-line blocks is okay -Style/BlockDelimiters: +Style/ParallelAssignment: Enabled: false -Style/CommentedKeyword: - Enabled: false +Style/StringLiterals: + EnforcedStyle: double_quotes + +Style/StringLiteralsInInterpolation: + EnforcedStyle: double_quotes