AllCops: Exclude: - lib/uuid.rb - test/syntax-book/* - tmp/* DisplayCopNames: true NewCops: enable require: - rubocop-performance #### Lint Lint/EmptyWhen: Enabled: true Lint/NestedMethodDefinition: Exclude: - 'test/*' Lint/AssignmentInCondition: Enabled: false Lint/ParenthesesAsGroupedExpression: Enabled: true Lint/UnderscorePrefixedVariableName: Enabled: true Lint/UnusedBlockArgument: Enabled: true Lint/UnusedMethodArgument: Enabled: true Lint/UselessAssignment: Enabled: true Lint/ErbNewArguments: Enabled: false Lint/DeprecatedOpenSSLConstant: Enabled: true Lint/MixedRegexpCaptureTypes: Enabled: true Lint/RaiseException: Enabled: true Lint/StructNewOverride: Enabled: true # make it enable when supporting only Ruby 3.0 and higher. Lint/RedundantDirGlobSort: Enabled: false #### Performance Performance/RegexpMatch: Enabled: false Performance/ReverseEach: Enabled: true # Use tr instead of gsub. Performance/StringReplacement: Enabled: true Performance/RangeInclude: Enabled: true Performance/DeletePrefix: Enabled: false Performance/RedundantMerge: Enabled: true Performance/AncestorsInclude: Enabled: true Performance/BigDecimalWithNumericArgument: Enabled: true Performance/RedundantSortBlock: Enabled: true Performance/RedundantStringChars: Enabled: true Performance/ReverseFirst: Enabled: true Performance/SortReverse: Enabled: true Performance/Squeeze: Enabled: true Performance/StringInclude: Enabled: false Performance/CollectionLiteralInLoop: Enabled: false #### Style Style/AccessModifierDeclarations: Enabled: false Style/AsciiComments: Enabled: false # Use alias_method instead of alias. Style/Alias: EnforcedStyle: prefer_alias_method Enabled: true Style/AndOr: Enabled: true Style/BarePercentLiterals: EnforcedStyle: percent_q Enabled: true Style/BlockDelimiters: Enabled: true Style/CaseEquality: Enabled: false Style/ClassCheck: Enabled: true Style/ClassMethods: Enabled: true Style/CommentedKeyword: Enabled: false Style/DocumentDynamicEvalDefinition: Enabled: false Style/FloatDivision: Enabled: false # Do not introduce global variables. Style/GlobalVars: Enabled: true # Use self-assignment shorthand +=. Style/SelfAssignment: Enabled: true Style/ConditionalAssignment: Enabled: false Style/Documentation: Enabled: false Style/Encoding: Enabled: true Style/EmptyElse: Enabled: true Style/EvalWithLocation: Enabled: true Style/FormatString: EnforcedStyle: sprintf Enabled: true Style/FormatStringToken: Enabled: false Style/GuardClause: Enabled: false Style/IfInsideElse: Enabled: false Style/IfUnlessModifier: Enabled: false Style/MutableConstant: Enabled: false Style/MultipleComparison: Enabled: true Style/RedundantInterpolation: Enabled: true Style/ZeroLengthPredicate: Enabled: false Style/NumericPredicate: EnforcedStyle: comparison Enabled: true Style/TernaryParentheses: Enabled: false Style/FrozenStringLiteralComment: EnforcedStyle: never Enabled: true Style/SafeNavigation: Enabled: false Style/EmptyMethod: EnforcedStyle: expanded Enabled: true Style/HashSyntax: Enabled: true Style/RescueModifier: Enabled: false Style/ClassAndModuleChildren: EnforcedStyle: nested Enabled: true Style/ColonMethodCall: Enabled: true Style/For: Enabled: true Style/InfiniteLoop: Enabled: true Style/LineEndConcatenation: Enabled: false Style/MethodCallWithoutArgsParentheses: Enabled: true Style/MethodCallWithArgsParentheses: IgnoredMethods: - 'require' - 'include' - 'file' - 'task' - 'desc' - 'info' - 'gem' - 'exit' - 'print' - 'puts' - 'write' - 'warn' - 'error' - 'raise' - 'yield' - 'source' - 'assert' - 'assert_equal' - 'assert_raise' - 'assert_raises' - 'assert_nothing_raised' - 'sh' - 'mv' - 'rm_rf' Enabled: true Style/MixinUsage: Enabled: false Style/MultilineBlockChain: Enabled: true Style/NegatedIf: Enabled: true Style/Next: Enabled: true Style/Not: Enabled: true Style/NumericLiterals: MinDigits: 6 Style/PercentLiteralDelimiters: Enabled: true Style/PercentQLiterals: EnforcedStyle: upper_case_q Enabled: true Style/PerlBackrefs: Enabled: false Style/RaiseArgs: EnforcedStyle: exploded Enabled: true Style/RedundantBegin: Enabled: false Style/RedundantParentheses: Enabled: true Style/RedundantReturn: Enabled: false Style/RedundantSelf: Enabled: false Style/RegexpLiteral: Enabled: true Style/RescueStandardError: Enabled: false Style/Semicolon: Enabled: true Style/SingleLineMethods: Enabled: true Style/SpecialGlobalVars: Enabled: true Style/StderrPuts: Enabled: false Style/StringLiterals: Enabled: true Style/StringLiteralsInInterpolation: Enabled: true Style/SymbolProc: Enabled: true Style/SymbolArray: Enabled: true Style/TrailingCommaInArrayLiteral: Enabled: true Style/TrailingCommaInHashLiteral: Enabled: true Style/WordArray: MinSize: 10 Style/RedundantPercentQ: Enabled: false Style/WhileUntilModifier: Enabled: false Style/YodaCondition: Enabled: true Style/ExponentialNotation: Enabled: true Style/HashEachMethods: Enabled: true Style/HashTransformKeys: Enabled: true Style/HashTransformValues: Enabled: true Style/RedundantFetchBlock: Enabled: true Style/RedundantRegexpCharacterClass: Enabled: true Style/RedundantRegexpEscape: Enabled: true Style/SlicingWithRange: Enabled: false Style/AccessorGrouping: Enabled: false Style/CaseLikeIf: Enabled: false Style/StringConcatenation: Enabled: false Style/OptionalBooleanParameter: Enabled: false Style/SoleNestedConditional: Enabled: false Style/CombinableLoops: Enabled: false ### Layout Layout/BlockAlignment: Enabled: true Layout/EndAlignment: Enabled: true Layout/MultilineMethodCallBraceLayout: Enabled: true Layout/AccessModifierIndentation: EnforcedStyle: indent Enabled: true Layout/ClosingHeredocIndentation: Enabled: false Layout/DotPosition: EnforcedStyle: trailing Enabled: true Layout/EmptyLines: Enabled: true Layout/EmptyLineAfterGuardClause: Enabled: true Layout/EmptyLinesAroundAccessModifier: Enabled: true Layout/EmptyLinesAroundClassBody: Enabled: true Layout/EmptyLinesAroundMethodBody: Enabled: true Layout/EmptyLinesAroundModuleBody: Enabled: true Layout/EndOfLine: Enabled: true Layout/ExtraSpacing: Enabled: true Layout/IndentationConsistency: Enabled: true Layout/IndentationWidth: Enabled: true Layout/FirstHashElementIndentation: Enabled: true Layout/HeredocIndentation: Enabled: false Layout/LeadingCommentSpace: Enabled: true Layout/MultilineOperationIndentation: Enabled: true Layout/SpaceAroundBlockParameters: EnforcedStyleInsidePipes: no_space Enabled: true Layout/SpaceAfterComma: Enabled: true Layout/SpaceAfterNot: Enabled: true Layout/SpaceAfterSemicolon: Enabled: true Layout/SpaceAroundEqualsInParameterDefault: Enabled: true Layout/SpaceAroundOperators: Enabled: true Layout/SpaceBeforeBlockBraces: Enabled: true Layout/SpaceBeforeComma: Enabled: true Layout/SpaceInsideBlockBraces: Enabled: true Layout/SpaceInsideHashLiteralBraces: Enabled: true Layout/SpaceInsideArrayLiteralBrackets: Enabled: true Layout/SpaceInsideStringInterpolation: EnforcedStyle: no_space Enabled: true Layout/TrailingEmptyLines: Enabled: true Layout/TrailingWhitespace: Enabled: true AllowInHeredoc: true Layout/EmptyLinesAroundAttributeAccessor: Enabled: true Layout/SpaceAroundMethodCallOperator: Enabled: true Layout/LineLength: Max: 256 Exclude: - "test/**/*" #### Metrics Metrics/BlockNesting: Max: 4 Metrics/ModuleLength: Max: 300 Metrics/ParameterLists: Max: 8 Metrics/PerceivedComplexity: Max: 28 Metrics/ClassLength: Max: 1500 Exclude: - 'test/*.rb' ### should be < 50 Metrics/MethodLength: Max: 100 Exclude: - "bin/review-*" - "bin/review2*" - "test/**/*" ### should be < 20 Metrics/CyclomaticComplexity: Max: 25 ### should be < 60 Metrics/AbcSize: Max: 120 Exclude: - "bin/review-*" - "test/**/*" ### shoud be < 25 Metrics/BlockLength: CountComments: false # count full line comments? Max: 62 Exclude: - 'Rakefile' - '**/*.rake' - 'test/**/*.rb' ## Naming Naming/AccessorMethodName: Enabled: true # When defining the == operator, name its argument other. Naming/BinaryOperatorParameterName: Enabled: true Naming/FileName: Enabled: false Naming/HeredocDelimiterNaming: Enabled: false Naming/MemoizedInstanceVariableName: Enabled: false Naming/MethodName: Enabled: true Naming/MethodParameterName: Enabled: false # Use snake_case for variable names. Naming/VariableName: Enabled: true Naming/VariableNumber: EnforcedStyle: normalcase Enabled: true Exclude: - test/* #### Security Security/YAMLLoad: Enabled: true #### Gemspec Gemspec/RequiredRubyVersion: Enabled: false