Skip to content

Instantly share code, notes, and snippets.

@Vchekryzhov
Last active August 17, 2022 21:43
Show Gist options
  • Save Vchekryzhov/d65bd8d69669c6fffb98ef3a95ac9f15 to your computer and use it in GitHub Desktop.
Save Vchekryzhov/d65bd8d69669c6fffb98ef3a95ac9f15 to your computer and use it in GitHub Desktop.
rubocop
# inherit_from:
# - ".rubocop-rspec.yml"
# - ".rubocop-rails.yml"
# require:
# - rubocop-rails
# - rubocop-rspec
AllCops:
TargetRubyVersion: 3
# TargetRailsVersion: 6.0
Exclude:
- "**/db/migrate/*"
- "**/Gemfile.lock"
- "**/Rakefile"
- "**/rails"
- "**/vendor/**/*"
- "**/spec_helper.rb"
- "node_modules/**/*"
- "bin/*"
Layout/ClassStructure:
ExpectedOrder:
- module_inclusion
- constants
- association
- public_attribute_macros
- public_delegate
- macros
- initializer
- public_class_methods
- public_methods
- protected_attribute_macros
- protected_methods
- private_attribute_macros
- private_delegate
- private_methods
Layout/EmptyLineAfterMultilineCondition:
Enabled: true
Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent
Layout/FirstArrayElementLineBreak:
Enabled: true
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent
Layout/FirstHashElementLineBreak:
Enabled: true
Layout/LineLength:
Max: 150
Exclude:
- "**/spec/**/*"
Layout/MultilineArrayBraceLayout:
EnforcedStyle: new_line
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
Layout/MultilineHashBraceLayout:
EnforcedStyle: new_line
Layout/MultilineHashKeyLineBreaks:
Enabled: true
Layout/MultilineMethodCallBraceLayout:
EnforcedStyle: new_line
Layout/MultilineMethodDefinitionBraceLayout:
EnforcedStyle: new_line
Layout/SpaceAroundMethodCallOperator:
Enabled: true
Layout/SpaceInLambdaLiteral:
EnforcedStyle: require_space
Lint/AmbiguousBlockAssociation:
Exclude:
- "**/spec/**/*"
Lint/AssignmentInCondition:
AllowSafeAssignment: false
Lint/BinaryOperatorWithIdenticalOperands:
Enabled: true
Lint/DeprecatedOpenSSLConstant:
Enabled: true
Lint/DuplicateElsifCondition:
Enabled: true
Lint/DuplicateRequire:
Enabled: true
Lint/DuplicateRescueException:
Enabled: true
Lint/EmptyConditionalBody:
Enabled: true
Lint/EmptyFile:
Enabled: true
Lint/FloatComparison:
Enabled: true
Lint/MissingSuper:
Enabled: true
Lint/MixedRegexpCaptureTypes:
Enabled: true
Lint/NumberConversion:
Enabled: true
Lint/RaiseException:
Enabled: true
Lint/SelfAssignment:
Enabled: true
Lint/TrailingCommaInAttributeDeclaration:
Enabled: true
Lint/UnusedBlockArgument:
IgnoreEmptyBlocks: false
Lint/UnusedMethodArgument:
IgnoreEmptyMethods: false
Lint/UselessMethodDefinition:
Enabled: true
# ============== Metric =================
Metrics/AbcSize:
Max: 45
Metrics/BlockLength:
CountComments: false
Max: 50
Exclude:
- "**/spec/**/*"
- "**/*.rake"
- "**/factories/**/*"
- "**/config/routes.rb"
Metrics/ClassLength:
CountAsOne: ["array", "hash"]
Max: 150
Metrics/CyclomaticComplexity:
Max: 10
Metrics/MethodLength:
CountAsOne: ["array", "hash"]
Max: 30
Metrics/ModuleLength:
CountAsOne: ["array", "hash"]
Max: 250
Exclude:
- "**/spec/**/*"
Metrics/PerceivedComplexity:
Max: 10
Style/AccessorGrouping:
Enabled: true
Style/ArrayCoercion:
Enabled: true
Style/AutoResourceCleanup:
Enabled: true
Style/BisectedAttrAccessor:
Enabled: true
Style/CaseLikeIf:
Enabled: true
Style/ClassAndModuleChildren:
Enabled: false
Style/CollectionMethods:
Enabled: true
Style/CombinableLoops:
Enabled: true
Style/CommandLiteral:
EnforcedStyle: percent_x
Style/ConstantVisibility:
Enabled: true
Style/Documentation:
Enabled: false
Style/ExplicitBlockArgument:
Enabled: true
Style/GlobalStdStream:
Enabled: true
Style/HashEachMethods:
Enabled: true
Style/HashLikeCase:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Style/ImplicitRuntimeError:
Enabled: true
Style/InlineComment:
Enabled: true
Style/IpAddresses:
Enabled: true
Style/KeywordParametersOrder:
Enabled: true
Style/MethodCallWithArgsParentheses:
Enabled: false
Style/MissingElse:
Enabled: false
Style/MultilineMethodSignature:
Enabled: true
Style/OptionalBooleanParameter:
Enabled: true
Style/RedundantAssignment:
Enabled: true
Style/RedundantBegin:
Enabled: true
Style/RedundantFetchBlock:
Enabled: true
Style/RedundantFileExtensionInRequire:
Enabled: true
Style/RedundantSelfAssignment:
Enabled: true
Style/SingleArgumentDig:
Enabled: true
Style/StringConcatenation:
Enabled: true
Style/Proc:
Enabled: false
Layout/SpaceBeforeBrackets: # (new in 1.7)
Enabled: true
Lint/AmbiguousAssignment: # (new in 1.7)
Enabled: true
Lint/DeprecatedConstants: # (new in 1.8)
Enabled: true
Lint/DuplicateBranch: # (new in 1.3)
Enabled: true
Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
Enabled: true
Lint/EmptyBlock: # (new in 1.1)
Enabled: true
Lint/EmptyClass: # (new in 1.3)
Enabled: true
Lint/EmptyInPattern: # (new in 1.16)
Enabled: true
Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
Enabled: true
Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
Enabled: true
Lint/NumberedParameterAssignment: # (new in 1.9)
Enabled: true
Lint/OrAssignmentToConstant: # (new in 1.9)
Enabled: true
Lint/RedundantDirGlobSort: # (new in 1.8)
Enabled: true
Lint/SymbolConversion: # (new in 1.9)
Enabled: true
Lint/ToEnumArguments: # (new in 1.1)
Enabled: true
Lint/TripleQuotes: # (new in 1.9)
Enabled: true
Lint/UnexpectedBlockArity: # (new in 1.5)
Enabled: true
Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
Enabled: true
Style/ArgumentsForwarding: # (new in 1.1)
Enabled: true
Style/CollectionCompact: # (new in 1.2)
Enabled: true
Style/DocumentDynamicEvalDefinition: # (new in 1.1)
Enabled: true
Style/EndlessMethod: # (new in 1.8)
Enabled: true
Style/HashConversion: # (new in 1.10)
Enabled: true
Style/HashExcept: # (new in 1.7)
Enabled: true
Style/IfWithBooleanLiteralBranches: # (new in 1.9)
Enabled: true
Style/InPatternThen: # (new in 1.16)
Enabled: true
Style/MultilineInPatternThen: # (new in 1.16)
Enabled: true
Style/NegatedIfElseCondition: # (new in 1.2)
Enabled: true
Style/NilLambda: # (new in 1.3)
Enabled: true
Style/QuotedSymbols: # (new in 1.16)
Enabled: true
Style/RedundantArgument: # (new in 1.4)
Enabled: true
Style/StringChars: # (new in 1.12)
Enabled: true
Style/SwapValues: # (new in 1.1)
Enabled: true
Layout/LineEndStringConcatenationIndentation: # (new in 1.18)
Enabled: true
Naming/InclusiveLanguage: # (new in 1.18)
Enabled: true
Style/FrozenStringLiteralComment:
Enabled: false
Style/DoubleNegation:
Enabled: false
Lint/AmbiguousRange: # (new in 1.19)
Enabled: true
Style/RedundantSelfAssignmentBranch: # (new in 1.19)
Enabled: true
Style/MultilineBlockChain:
Enabled: false
Gemspec/DeprecatedAttributeAssignment: # new in 1.30
Enabled: true
Gemspec/RequireMFA: # new in 1.23
Enabled: true
Layout/LineContinuationLeadingSpace: # new in 1.31
Enabled: true
Layout/LineContinuationSpacing: # new in 1.31
Enabled: true
Lint/AmbiguousOperatorPrecedence: # new in 1.21
Enabled: true
Lint/ConstantOverwrittenInRescue: # new in 1.31
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
Naming/BlockForwarding: # new in 1.24
Enabled: true
Security/CompoundHash: # new in 1.28
Enabled: true
Security/IoMethods: # new in 1.22
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/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/RedundantInitialize: # new in 1.27
Enabled: true
Style/SelectByRegexp: # new in 1.22
Enabled: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment