.rubocop.yml
require:
- rubocop-performance
AllCops:
AutoCorrect: false
SuggestExtensions: false
Exclude:
- 'click_house.gemspec'
- 'bin/*'
- 'lib/click_house/benchmark/*'
- 'spec/**/*'
- 'vendor/**/*'
TargetRubyVersion: 2.7
Bundler/OrderedGems:
Enabled: false
# ============================== Gemspec ======================
Gemspec/DeprecatedAttributeAssignment:
Enabled: true
Gemspec/RequireMFA: # new in 1.23
Enabled: true
# =============================== Performance =======================
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: true
Performance/Sum:
Enabled: true
Performance/ArraySemiInfiniteRangeSlice:
Enabled: true
Performance/BlockGivenWithExplicitBlock:
Enabled: true
Performance/CollectionLiteralInLoop:
Enabled: true
Performance/ConstantRegexp:
Enabled: true
Performance/MethodObjectAsBlock:
Enabled: false
Performance/RedundantEqualityComparisonBlock:
Enabled: true
Performance/RedundantSplitRegexpArgument:
Enabled: true
Performance/MapCompact:
Enabled: true
Performance/ConcurrentMonotonicTime: # new in 1.12
Enabled: true
Performance/StringIdentifierArgument: # new in 1.13
Enabled: true
# ============================== Metrics ============================
Metrics/ClassLength:
Max: 180
Metrics/BlockLength:
Enabled: true
Metrics/MethodLength:
Max: 25
Metrics/AbcSize:
Max: 40
# ============================== Naming =============================
Naming/PredicateName:
ForbiddenPrefixes:
- is_
Naming/FileName:
Enabled: true
Exclude:
- 'Gemfile'
Naming/MethodParameterName:
Enabled: false
Naming/AccessorMethodName:
Enabled: false
Naming/InclusiveLanguage:
Enabled: true
Naming/BlockForwarding: # new in 1.24
Enabled: true
# ============================== Layout =============================
Layout/LineLength:
Max: 140
Layout/HashAlignment:
EnforcedHashRocketStyle: key
EnforcedColonStyle: key
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
Layout/CaseIndentation:
EnforcedStyle: case
IndentOneStep: false
Layout/MultilineMethodCallIndentation:
Enabled: true
EnforcedStyle: indented
Layout/SpaceBeforeBlockBraces:
EnforcedStyle: space
EnforcedStyleForEmptyBraces: space
Layout/EmptyLines:
Enabled: true
Layout/EmptyLineAfterMagicComment:
Enabled: false
Layout/EmptyLinesAroundBlockBody:
Enabled: true
Layout/EndAlignment:
EnforcedStyleAlignWith: variable
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent
Layout/HeredocIndentation:
Enabled: false
Layout/RescueEnsureAlignment:
Enabled: false
Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true
Layout/SpaceAroundMethodCallOperator:
Enabled: true
Layout/SpaceBeforeBrackets:
Enabled: true
Layout/LineEndStringConcatenationIndentation:
Enabled: true
Layout/LineContinuationLeadingSpace: # new in 1.31
Enabled: true
Layout/LineContinuationSpacing: # new in 1.31
Enabled: true
# ============================== Style ==============================
Style/RescueModifier:
Enabled: true
Style/PercentLiteralDelimiters:
PreferredDelimiters:
default: '[]'
'%i': '[]'
'%w': '[]'
Exclude:
- 'config/routes.rb'
Style/StringLiterals:
Enabled: true
Style/AsciiComments:
Enabled: false
Style/Copyright:
Enabled: false
Style/SafeNavigation:
Enabled: false
Style/Lambda:
Enabled: false
Style/Alias:
Enabled: true
EnforcedStyle: prefer_alias_method
Style/ClassAndModuleChildren:
Enabled: true
EnforcedStyle: nested
Style/TrailingCommaInArrayLiteral:
Enabled: true
EnforcedStyleForMultiline: no_comma
Style/RescueStandardError:
Enabled: true
EnforcedStyle: explicit
Style/InverseMethods:
AutoCorrect: false
Enabled: true
Style/IfUnlessModifier:
Enabled: false
Style/SpecialGlobalVars:
Enabled: false
Style/BlockComments:
Enabled: false
Style/GuardClause:
Enabled: false
Style/TrailingCommaInHashLiteral:
Enabled: false
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: true
Style/AccessorGrouping:
Enabled: false
Style/ArrayCoercion:
Enabled: true
Style/BisectedAttrAccessor:
Enabled: true
Style/CaseLikeIf:
Enabled: true
Style/HashAsLastArrayItem:
Enabled: true
Style/HashLikeCase:
Enabled: true
Style/RedundantAssignment:
Enabled: true
Style/RedundantFileExtensionInRequire:
Enabled: true
Style/ExplicitBlockArgument:
Enabled: true
Style/GlobalStdStream:
Enabled: true
Style/OptionalBooleanParameter:
Enabled: true
Style/SingleArgumentDig:
Enabled: true
Style/StringConcatenation:
Enabled: true
Style/ClassEqualityComparison:
Enabled: true
Style/CombinableLoops:
Enabled: true
Style/KeywordParametersOrder:
Enabled: false
Style/RedundantSelfAssignment:
Enabled: true
Style/SoleNestedConditional:
Enabled: true
Style/ArgumentsForwarding:
Enabled: true
Style/CollectionCompact:
Enabled: true
Style/DocumentDynamicEvalDefinition:
Enabled: false
Style/NegatedIfElseCondition:
Enabled: true
Style/NilLambda:
Enabled: true
Style/SwapValues:
Enabled: true
Style/RedundantArgument:
Enabled: true
Style/HashExcept:
Enabled: true
Style/EndlessMethod:
Enabled: true
Style/IfWithBooleanLiteralBranches:
Enabled: true
Style/HashConversion:
Enabled: true
Style/Documentation:
Enabled: false
Style/InPatternThen:
Enabled: true
Style/MultilineInPatternThen:
Enabled: true
Style/QuotedSymbols:
Enabled: true
Style/StringChars:
Enabled: true
Style/EmptyHeredoc: # new in 1.32
Enabled: true
Style/EnvHome: # new in 1.29
Enabled: true
Style/FetchEnvVar: # new in 1.28
Enabled: true
Style/FileRead: # new in 1.24
Enabled: true
Style/FileWrite: # new in 1.24
Enabled: true
Style/MagicCommentFormat: # new in 1.35
Enabled: true
Style/MapCompactWithConditionalBlock: # new in 1.30
Enabled: true
Style/MapToHash: # new in 1.24
Enabled: true
Style/NestedFileDirname: # new in 1.26
Enabled: true
Style/NumberedParameters: # new in 1.22
Enabled: true
Style/NumberedParametersLimit: # new in 1.22
Enabled: true
Style/ObjectThen: # new in 1.28
Enabled: true
Style/OpenStructUse: # new in 1.23
Enabled: true
Style/OperatorMethodCall: # new in 1.37
Enabled: true
Style/RedundantEach: # new in 1.38
Enabled: true
Style/RedundantInitialize: # new in 1.27
Enabled: true
Style/RedundantSelfAssignmentBranch: # new in 1.19
Enabled: true
Style/RedundantStringEscape: # new in 1.37
Enabled: true
Style/SelectByRegexp: # new in 1.22
Enabled: true
# ============================== Security ==============================
Security/CompoundHash: # new in 1.28
Enabled: true
Security/IoMethods: # new in 1.22
Enabled: true
# ============================== Lint ==============================
Lint/DuplicateMethods:
Enabled: false
Lint/AmbiguousOperator:
Enabled: false
Lint/DeprecatedOpenSSLConstant:
Enabled: true
Lint/MixedRegexpCaptureTypes:
Enabled: true
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Lint/DuplicateElsifCondition:
Enabled: true
Lint/BinaryOperatorWithIdenticalOperands:
Enabled: true
Lint/DuplicateRescueException:
Enabled: true
Lint/EmptyConditionalBody:
Enabled: true
Lint/FloatComparison:
Enabled: true
Lint/MissingSuper:
Enabled: false
Lint/OutOfRangeRegexpRef:
Enabled: true
Lint/SelfAssignment:
Enabled: true
Lint/TopLevelReturnWithArgument:
Enabled: true
Lint/UnreachableLoop:
Enabled: true
Layout/BeginEndAlignment:
Enabled: true
Lint/ConstantDefinitionInBlock:
Enabled: true
Lint/DuplicateRequire:
Enabled: true
Lint/EmptyFile:
Enabled: true
Lint/HashCompareByIdentity:
Enabled: true
Lint/IdentityComparison:
Enabled: true
Lint/RedundantSafeNavigation:
Enabled: true
Lint/TrailingCommaInAttributeDeclaration:
Enabled: true
Lint/UselessMethodDefinition:
Enabled: true
Lint/UselessTimes:
Enabled: true
Lint/DuplicateBranch:
Enabled: true
Lint/DuplicateRegexpCharacterClassElement:
Enabled: true
Lint/EmptyBlock:
Enabled: true
Lint/EmptyClass:
Enabled: true
Lint/NoReturnInBeginEndBlocks:
Enabled: true
Lint/ToEnumArguments:
Enabled: true
Lint/UnmodifiedReduceAccumulator:
Enabled: true
Lint/UnexpectedBlockArity:
Enabled: true
Lint/DeprecatedConstants:
Enabled: true
Lint/LambdaWithoutLiteralBlock:
Enabled: true
Lint/NumberedParameterAssignment:
Enabled: true
Lint/OrAssignmentToConstant:
Enabled: true
Lint/RedundantDirGlobSort:
Enabled: true
Lint/SymbolConversion:
Enabled: true
Lint/TripleQuotes:
Enabled: true
Lint/AmbiguousAssignment:
Enabled: true
Lint/EmptyInPattern:
Enabled: true
Lint/AmbiguousOperatorPrecedence: # new in 1.21
Enabled: true
Lint/AmbiguousRange: # new in 1.19
Enabled: true
Lint/ConstantOverwrittenInRescue: # new in 1.31
Enabled: true
Lint/DuplicateMagicComment: # new in 1.37
Enabled: true
Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
Enabled: true
Lint/NonAtomicFileOperation: # new in 1.31
Enabled: true
Lint/RefinementImportMethods: # new in 1.27
Enabled: true
Lint/RequireRangeParentheses: # new in 1.32
Enabled: true
Lint/RequireRelativeSelfPath: # new in 1.22
Enabled: true
Lint/UselessRuby2Keywords: # new in 1.23
Enabled: true