Skip to content

Instantly share code, notes, and snippets.

@pat
Last active April 21, 2021 09:38
Show Gist options
  • Save pat/ba3b8ffb1901bfe5439b460943b6b019 to your computer and use it in GitHub Desktop.
Save pat/ba3b8ffb1901bfe5439b460943b6b019 to your computer and use it in GitHub Desktop.
Shared Personal Rubocop configuration.
AllCops:
TargetRubyVersion: 2.5
Exclude:
- 'db/schema.rb'
- 'vendor/**/*'
Layout/ArgumentAlignment:
EnforcedStyle: with_fixed_indentation
Layout/DotPosition:
EnforcedStyle: trailing
Layout/HashAlignment:
EnforcedHashRocketStyle: table
Layout/LineLength:
Max: 80
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space
Layout/SpaceInsidePercentLiteralDelimiters:
Enabled: false
Lint/UselessAccessModifier:
MethodCreatingMethods:
- delegate
Metrics/BlockLength:
Exclude:
- 'spec/**/*_spec.rb'
Naming/RescuedExceptionsVariableName:
PreferredName: error
Style/ClassAndModuleChildren:
Enabled: false
Style/Documentation:
Enabled: false
Style/EachWithObject:
Enabled: false
Style/FrozenStringLiteralComment:
EnforcedStyle: always
Style/HashSyntax:
EnforcedStyle: hash_rockets
Style/Lambda:
EnforcedStyle: lambda
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
Style/TrivialAccessors:
IgnoreClassMethods: true
# 0.80
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
# 0.81
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
# 0.82
Layout/SpaceAroundMethodCallOperator:
Enabled: true
Style/ExponentialNotation:
Enabled: true
# 0.83
Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true
Style/SlicingWithRange:
Enabled: true
# 0.84
Lint/DeprecatedOpenSSLConstant:
Enabled: true
# 0.85
Lint/MixedRegexpCaptureTypes:
Enabled: true
Style/RedundantRegexpCharacterClass:
Enabled: true
Style/RedundantRegexpEscape:
Enabled: true
# 0.86
Style/RedundantFetchBlock:
Enabled: true
# 0.87
Style/AccessorGrouping:
Enabled: true
Style/BisectedAttrAccessor:
Enabled: true
Style/RedundantAssignment:
Enabled: true
# 0.88
Lint/DuplicateElsifCondition:
Enabled: true
Style/ArrayCoercion:
Enabled: true
Style/CaseLikeIf:
Enabled: true
Style/HashAsLastArrayItem:
Enabled: true
Style/HashLikeCase:
Enabled: true
Style/RedundantFileExtensionInRequire:
Enabled: true
# 0.89
Lint/BinaryOperatorWithIdenticalOperands:
Enabled: true
Lint/DuplicateRescueException:
Enabled: true
Lint/EmptyConditionalBody:
Enabled: true
Lint/FloatComparison:
Enabled: true
Lint/MissingSuper:
Enabled: true
Lint/OutOfRangeRegexpRef:
Enabled: true
Lint/SelfAssignment:
Enabled: true
Lint/TopLevelReturnWithArgument:
Enabled: true
Lint/UnreachableLoop:
Enabled: true
Style/ExplicitBlockArgument:
Enabled: true
Style/GlobalStdStream:
Enabled: true
Style/OptionalBooleanParameter:
Enabled: true
Style/SingleArgumentDig:
Enabled: true
Style/StringConcatenation:
Enabled: true
# 0.90
Lint/DuplicateRequire:
Enabled: true
Lint/EmptyFile:
Enabled: true
Lint/TrailingCommaInAttributeDeclaration:
Enabled: true
Lint/UselessMethodDefinition:
Enabled: true
Style/CombinableLoops:
Enabled: true
Style/KeywordParametersOrder:
Enabled: true
Style/RedundantSelfAssignment:
Enabled: true
Style/SoleNestedConditional:
Enabled: true
# 0.91
Layout/BeginEndAlignment:
Enabled: true
Lint/ConstantDefinitionInBlock:
Enabled: true
Lint/IdentityComparison:
Enabled: true
Lint/UselessTimes:
Enabled: true
# 0.93
Lint/HashCompareByIdentity:
Enabled: true
Lint/RedundantSafeNavigation:
Enabled: true
Style/ClassEqualityComparison:
Enabled: true
# 1.7:
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
# 1.8
Performance/Sum:
Enabled: true
# 2.7
Rails/ActiveRecordCallbacksOrder:
Enabled: true
Rails/FindById:
Enabled: true
Rails/Inquiry:
Enabled: true
Rails/MailerName:
Enabled: true
Rails/MatchRoute:
Enabled: true
Rails/NegateInclude:
Enabled: true
Rails/Pluck:
Enabled: true
Rails/PluckId:
Enabled: true
Rails/PluckInWhere:
Enabled: true
Rails/RenderInline:
Enabled: true
Rails/RenderPlainText:
Enabled: true
Rails/ShortI18n:
Enabled: true
Rails/WhereExists:
Enabled: true
# 2.8
Rails/AfterCommitOverride:
Enabled: true
Rails/SquishedSQLHeredocs:
Enabled: true
Rails/WhereNot:
Enabled: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment