AllCops: Exclude: - lib/lineinput.rb - lib/uuid.rb - test/syntax-book/* DisplayCopNames: true inherit_from: .rubocop_todo.yml #### Lint Lint/EmptyWhen: Enabled: true Lint/NestedMethodDefinition: Exclude: - 'test/*' Lint/AssignmentInCondition: Enabled: false Lint/ParenthesesAsGroupedExpression: Enabled: true #Lint/RescueWithoutErrorClass: # Enabled: false Lint/UnderscorePrefixedVariableName: Enabled: true Lint/UnusedBlockArgument: Enabled: true Lint/UnusedMethodArgument: Enabled: true Lint/UselessAssignment: Enabled: true #### Performance Performance/RegexpMatch: Enabled: false Performance/ReverseEach: Enabled: true # Use tr instead of gsub. Performance/StringReplacement: Enabled: false Performance/RangeInclude: Enabled: true #### 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: false Style/BarePercentLiterals: EnforcedStyle: percent_q Enabled: true Style/BlockDelimiters: Enabled: true Style/BracesAroundHashParameters: Enabled: false Style/CaseEquality: Enabled: false Style/ClassCheck: Enabled: true Style/ClassMethods: Enabled: true Style/CommentedKeyword: 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: false 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/UnneededInterpolation: Enabled: true Performance/RedundantMerge: 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/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/UnneededPercentQ: Enabled: false Style/WhileUntilModifier: Enabled: false #Style/YodaCondition: # Enabled: true ### Layout Layout/BlockAlignment: Enabled: true Layout/EndAlignment: Enabled: AlignWith 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: false Layout/EmptyLinesAroundAccessModifier: Enabled: true Layout/EmptyLinesAroundClassBody: Enabled: true Layout/EmptyLinesAroundMethodBody: Enabled: true Layout/EmptyLinesAroundModuleBody: Enabled: true Layout/EndOfLine: Enabled: false Layout/ExtraSpacing: Enabled: true Layout/IndentationConsistency: Enabled: true Layout/IndentationWidth: Enabled: true Layout/IndentHash: Enabled: true Layout/IndentHeredoc: Enabled: false Layout/LeadingCommentSpace: Enabled: true Layout/MultilineOperationIndentation: Enabled: false 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: false Layout/SpaceBeforeComma: Enabled: true Layout/SpaceInsideBlockBraces: Enabled: true Layout/SpaceInsideHashLiteralBraces: Enabled: true Layout/SpaceInsideArrayLiteralBrackets: Enabled: true Layout/SpaceInsideStringInterpolation: EnforcedStyle: no_space Enabled: true Layout/TrailingBlankLines: Enabled: true #### Metrics Metrics/BlockNesting: Max: 4 Metrics/ModuleLength: Max: 200 Metrics/ParameterLists: Max: 8 Metrics/PerceivedComplexity: Max: 28 Metrics/ClassLength: Max: 1500 Exclude: - 'test/*.rb' Metrics/LineLength: Max: 256 Exclude: - "test/**/*" ### should be < 50 Metrics/MethodLength: Max: 100 Exclude: - "bin/review-*" - "bin/review2*" - "test/**/*" ### should be < 20 Metrics/CyclomaticComplexity: Max: 32 ### 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. #Style/BinaryOperatorParameterName: # Enabled: true Naming/FileName: Enabled: false Naming/HeredocDelimiterNaming: Enabled: false Naming/MemoizedInstanceVariableName: Enabled: false Naming/MethodName: Enabled: true Naming/UncommunicativeMethodParamName: Enabled: false # Use snake_case for variable names. Naming/VariableName: Enabled: true Naming/VariableNumber: EnforcedStyle: normalcase Enabled: true #### Security # we use Date object in config.yml so should use YAML.load :-/ Security/YAMLLoad: Exclude: - 'lib/review/catalog.rb' - 'test/test_helper.rb'