123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388 |
- require:
- - rubocop-rspec
- AllCops:
- TargetRubyVersion: 2.7
- # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
- # to ignore them, so only the ones explicitly set in this file are enabled.
- DisabledByDefault: true
- # Prefer &&/|| over and/or.
- Style/AndOr:
- Enabled: true
- # Align `when` with `case`.
- Layout/CaseIndentation:
- Enabled: true
- Layout/ClosingHeredocIndentation:
- Enabled: true
- # Align comments with method definitions.
- Layout/CommentIndentation:
- Enabled: true
- Layout/ElseAlignment:
- Enabled: true
- # Align `end` with the matching keyword or starting expression except for
- # assignments, where it should be aligned with the LHS.
- Layout/EndAlignment:
- Enabled: true
- EnforcedStyleAlignWith: variable
- AutoCorrect: true
- Layout/EmptyLineAfterMagicComment:
- Enabled: true
- Layout/EmptyLineAfterMultilineCondition:
- Enabled: true
- Layout/EmptyLinesAroundAccessModifier:
- Enabled: true
- EnforcedStyle: only_before
- Layout/EmptyLinesAroundBlockBody:
- Enabled: true
- # In a regular class definition, no empty lines around the body.
- Layout/EmptyLinesAroundClassBody:
- Enabled: true
- # In a regular method definition, no empty lines around the body.
- Layout/EmptyLinesAroundMethodBody:
- Enabled: true
- # In a regular module definition, no empty lines around the body.
- Layout/EmptyLinesAroundModuleBody:
- Enabled: true
- # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
- Style/HashSyntax:
- Enabled: true
- Layout/FirstArgumentIndentation:
- Enabled: true
- # Method definitions after `private` or `protected` isolated calls need one
- # extra level of indentation.
- Layout/IndentationConsistency:
- Enabled: true
- EnforcedStyle: indented_internal_methods
- # Detect hard tabs, no hard tabs.
- Layout/IndentationStyle:
- Enabled: true
- # Two spaces, no tabs (for indentation).
- Layout/IndentationWidth:
- Enabled: true
- Layout/LeadingCommentSpace:
- Enabled: true
- Layout/SpaceAfterColon:
- Enabled: true
- Layout/SpaceAfterComma:
- Enabled: true
- Layout/SpaceAfterSemicolon:
- Enabled: true
- Layout/SpaceAroundEqualsInParameterDefault:
- Enabled: true
- Layout/SpaceAroundKeyword:
- Enabled: true
- Layout/SpaceBeforeComma:
- Enabled: true
- Layout/SpaceBeforeComment:
- Enabled: true
- Layout/SpaceBeforeFirstArg:
- Enabled: true
- Style/ClassMethodsDefinitions:
- Enabled: true
- EnforcedStyle: def_self
- Style/DefWithParentheses:
- Enabled: true
- # Defining a method with parameters needs parentheses.
- Style/MethodDefParentheses:
- Enabled: true
- Style/MethodCallWithArgsParentheses:
- Enabled: true
- IgnoredMethods:
- # Gemfile, gemspec
- - source
- - add_dependency
- - add_development_dependency
- # include/require
- - require
- - require_relative
- - include
- # fundamental methods
- - raise
- - sleep
- # RSpec
- - describe
- - it
- - to
- - not_to
- - be
- - eq
- # async/await
- - define_async_method
- - await
- - future
- # utils
- - debug_print
- - debug_puts
- - exit
- - puts
- Style/MethodCallWithoutArgsParentheses:
- Enabled: true
- Style/RedundantFreeze:
- Enabled: true
- Style/RedundantSelf:
- Enabled: true
- Style/RedundantSelfAssignment:
- Enabled: true
- # Use `foo {}` not `foo{}`.
- Layout/SpaceBeforeBlockBraces:
- Enabled: true
- # Use `foo { bar }` not `foo {bar}`.
- Layout/SpaceInsideBlockBraces:
- Enabled: true
- EnforcedStyleForEmptyBraces: space
- # Use `{ a: 1 }` not `{a:1}`.
- Layout/SpaceInsideHashLiteralBraces:
- Enabled: true
- Layout/SpaceInsideParens:
- Enabled: true
- # Empty lines should not have any spaces.
- Layout/TrailingEmptyLines:
- Enabled: true
- # No trailing whitespace.
- Layout/TrailingWhitespace:
- Enabled: true
- # Use quotes for string literals when they are enough.
- Style/RedundantPercentQ:
- Enabled: true
- Lint/AmbiguousOperator:
- Enabled: true
- Lint/AmbiguousRegexpLiteral:
- Enabled: true
- Lint/BinaryOperatorWithIdenticalOperands:
- Enabled: true
- Lint/DeprecatedClassMethods:
- Enabled: true
- Lint/DuplicateRescueException:
- Enabled: true
- Lint/ErbNewArguments:
- Enabled: true
- Lint/EmptyConditionalBody:
- Enabled: true
- Lint/FloatComparison:
- Enabled: true
- Lint/OutOfRangeRegexpRef:
- Enabled: true
- Lint/RedundantStringCoercion:
- Enabled: true
- # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
- Lint/RequireParentheses:
- Enabled: true
- Lint/SelfAssignment:
- Enabled: true
- Lint/ShadowingOuterLocalVariable:
- Enabled: true
- Lint/TopLevelReturnWithArgument:
- Enabled: true
- Lint/UnreachableLoop:
- Enabled: true
- Lint/UriEscapeUnescape:
- Enabled: true
- Lint/UselessAssignment:
- Enabled: true
- Style/ParenthesesAroundCondition:
- Enabled: true
- Style/ExplicitBlockArgument:
- Enabled: true
- Style/FrozenStringLiteralComment:
- Enabled: false
- Style/GlobalStdStream:
- Enabled: true
- Style/HashEachMethods:
- Enabled: true
- Style/HashTransformKeys:
- Enabled: true
- Style/HashTransformValues:
- Enabled: true
- Style/RaiseArgs:
- Enabled: true
- EnforcedStyle: compact
- Style/RedundantBegin:
- Enabled: true
- Style/RedundantReturn:
- Enabled: true
- AllowMultipleReturnValues: true
- Style/Semicolon:
- Enabled: true
- AllowAsExpressionSeparator: true
- Style/StringConcatenation:
- Enabled: true
- # Prefer Foo.method over Foo::method
- Style/ColonMethodCall:
- Enabled: true
- Style/TrivialAccessors:
- Enabled: false
- Style/AccessModifierDeclarations:
- Enabled: true
- EnforcedStyle: inline
- Style/ClassAndModuleChildren:
- EnforcedStyle: compact
- Style/TrailingCommaInArguments:
- Enabled: true
- EnforcedStyleForMultiline: comma
- Style/TrailingCommaInArrayLiteral:
- Enabled: true
- EnforcedStyleForMultiline: comma
- Style/TrailingCommaInHashLiteral:
- Enabled: true
- EnforcedStyleForMultiline: comma
- # rubocop-rspec
- RSpec/EmptyLineAfterExampleGroup:
- Enabled: true
- RSpec/EmptyLineAfterHook:
- Enabled: true
- # bad: expect("success").to eq(result)
- # good: expect(result).to eq("success")
- RSpec/ExpectActual:
- Enabled: true
- # bad: expect{ subject }.to change(Hoge, :count).by(1)
- # good: expect{ subject }.to change{ Hoge.count }.by(1)
- RSpec/ExpectChange:
- Enabled: true
- EnforcedStyle: block
- RSpec/ExpectInHook:
- Enabled: true
- RSpec/ImplicitBlockExpectation:
- Enabled: true
- RSpec/InstanceVariable:
- Enabled: true
- # bad: it_should_behave_like
- # good: it_behaves_like
- RSpec/ItBehavesLike:
- Enabled: true
- RSpec/LeakyConstantDeclaration:
- Enabled: false
- RSpec/LetSetup:
- Enabled: true
- RSpec/MultipleSubjects:
- Enabled: true
- RSpec/NestedGroups:
- Enabled: true
- Max: 4
- RSpec/NotToNot:
- Enabled: true
- RSpec/PredicateMatcher:
- Enabled: true
- RSpec/ReceiveCounts:
- Enabled: true
- RSpec/ReceiveNever:
- Enabled: true
- RSpec/ReturnFromStub:
- Enabled: true
- EnforcedStyle: and_return
- RSpec/SharedContext:
- Enabled: true
- RSpec/SharedExamples:
- Enabled: true
- RSpec/SingleArgumentMessageChain:
- Enabled: true
- RSpec/VoidExpect:
- Enabled: true
- RSpec/Yield:
- Enabled: true
|