# See example at https://github.com/bbatsov/rubocop/blob/master/config/default.yml require: - rubocop-performance - rubocop-rails - rubocop-rspec AllCops: NewCops: enable TargetRubyVersion: 3.0 Exclude: - 'app/admin/**/*.rb' - 'bin/**/*' - 'config/**/*.rb' - 'db/schema.rb' - 'db/migrate/**/*' - 'lib/tasks/**/*' - 'node_modules/**/*' - 'tmp/**/*' - 'vendor/**/*' # Align the elements of a hash literal if they span more than one line. Layout/HashAlignment: # Alignment of entries using hash rocket as separator. Valid values are: # # key - left alignment of keys # 'a' => 2 # 'bb' => 3 # separator - alignment of hash rockets, keys are right aligned # 'a' => 2 # 'bb' => 3 # table - left alignment of keys, hash rockets, and values # 'a' => 2 # 'bb' => 3 EnforcedHashRocketStyle: table # Alignment of entries using colon as separator. Valid values are: # # key - left alignment of keys # a: 0 # bb: 1 # separator - alignment of colons, keys are right aligned # a: 0 # bb: 1 # table - left alignment of keys and values # a: 0 # bb: 1 EnforcedColonStyle: table Style/Documentation: Enabled: false Layout/EmptyLines: Enabled: false Layout/LineLength: Max: 150 Lint/BinaryOperatorWithIdenticalOperands: Enabled: true Lint/DuplicateElsifCondition: 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 Metrics/AbcSize: Enabled: true Max: 25 Metrics/ClassLength: Enabled: false CountComments: false Metrics/BlockLength: Enabled: false CountComments: false Metrics/MethodLength: Enabled: true CountComments: false Max: 25 Naming/MethodParameterName: MinNameLength: 2 Naming/BlockParameterName: MinNameLength: 2 Naming/VariableNumber: EnforcedStyle: normalcase Lint/ConstantDefinitionInBlock: Enabled: true Lint/DeprecatedOpenSSLConstant: Enabled: true Lint/DuplicateRequire: Enabled: true Layout/EmptyLinesAroundBlockBody: Enabled: false Layout/EmptyLinesAroundAttributeAccessor: Enabled: true Lint/EmptyFile: Enabled: true Lint/IdentityComparison: Enabled: true Lint/MixedRegexpCaptureTypes: Enabled: false Lint/TrailingCommaInAttributeDeclaration: Enabled: true Lint/UselessMethodDefinition: Enabled: true Lint/UselessTimes: Enabled: true Layout/BeginEndAlignment: Enabled: true #Checks method call operators to not have spaces around them. Layout/SpaceAroundMethodCallOperator: Enabled: true Layout/SpaceInsideParens: Enabled: false Layout/SpaceBeforeFirstArg: Enabled: false Lint/RaiseException: Enabled: true Lint/StructNewOverride: 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: true Rails/ActiveRecordCallbacksOrder: Enabled: true Rails/ApplicationController: Enabled: true Rails/AfterCommitOverride: Enabled: true Rails/WhereNot: Enabled: true Rails/FindById: Enabled: true Rails/HasAndBelongsToMany: Enabled: false Rails/Inquiry: Enabled: true Rails/MailerName: Enabled: true Rails/MatchRoute: Enabled: true Rails/NegateInclude: Enabled: true Rails/Pluck: Enabled: true Rails/PluckInWhere: Enabled: true Rails/RenderInline: Enabled: true Rails/RenderPlainText: Enabled: true Rails/SquishedSQLHeredocs: Enabled: true Rails/ShortI18n: Enabled: true Rails/WhereExists: Enabled: true Style/AccessModifierDeclarations: Enabled: false Style/AccessorGrouping: Enabled: true Style/ArrayCoercion: Enabled: true Style/BisectedAttrAccessor: Enabled: true Style/BlockDelimiters: Enabled: false Style/CaseLikeIf: Enabled: true Style/ClassAndModuleChildren: Enabled: true EnforcedStyle: compact Style/CombinableLoops: Enabled: true Style/ExplicitBlockArgument: Enabled: true Style/ExponentialNotation: Enabled: false Style/FetchEnvVar: Enabled: true Style/FrozenStringLiteralComment: Enabled: true Style/GlobalStdStream: Enabled: true Style/HashAsLastArrayItem: Enabled: true Style/HashEachMethods: Enabled: true Style/HashLikeCase: Enabled: true Style/HashTransformKeys: Enabled: true Style/HashTransformValues: Enabled: true Style/KeywordParametersOrder: Enabled: true Style/OptionalBooleanParameter: Enabled: true Style/RedundantAssignment: Enabled: true Style/RedundantSelfAssignment: Enabled: true Style/RedundantFetchBlock: Enabled: true Style/RedundantFileExtensionInRequire: Enabled: true Style/RedundantReturn: Enabled: false Style/RedundantRegexpCharacterClass: Enabled: true Style/RedundantRegexpEscape: Enabled: false Style/SingleArgumentDig: Enabled: true Style/SlicingWithRange: Enabled: true Style/SoleNestedConditional: Enabled: true Style/StringConcatenation: Enabled: true Style/TrailingCommaInArguments: Enabled: true EnforcedStyleForMultiline: comma Style/TrailingCommaInArrayLiteral: Enabled: true EnforcedStyleForMultiline: comma Style/TrailingCommaInHashLiteral: Enabled: true EnforcedStyleForMultiline: comma Style/AndOr: Enabled: false # https://github.com/codeclimate/codeclimate-rubocop/blob/master/base_rubocop.yml#L71 # We use %w[ ], not %w( ) because the former looks like an array Style/PercentLiteralDelimiters: Enabled: false RSpec/AnyInstance: Enabled: false RSpec/ExampleLength: Max: 70 RSpec/MessageSpies: EnforcedStyle: receive RSpec/MessageChain: Enabled: false RSpec/MultipleExpectations: Enabled: false RSpec/MultipleMemoizedHelpers: Max: 25 RSpec/NamedSubject: Enabled: false RSpec/NestedGroups: Max: 10 RSpec/StubbedMock: Enabled: false RSpec/ContextWording: Enabled: false