Skip to content

Commit

Permalink
rubocopのセットアップ #17
Browse files Browse the repository at this point in the history
  • Loading branch information
ishi720 committed May 28, 2024
1 parent c3e1d81 commit 46be958
Show file tree
Hide file tree
Showing 4 changed files with 523 additions and 3 deletions.
243 changes: 243 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
inherit_from: .rubocop_todo.yml
require:
- rubocop-rails
- rubocop-performance
- rubocop-rspec

AllCops:
TargetRubyVersion: 3.1
Exclude:
- 'vendor/**/*'
- 'db/**/*'
- 'lib/tasks/**/*'
- "db/schema.rb"
- 'bin/*'
- 'test/*'
- 'node_modules/**/*'
- 'config/initializers/**/*'
- 'public/**/*'
- 'storage/**/*'
- 'log/**/*'
- 'tmp/**/*'
- 'terraform/**/*'
- 'openapi/**/*'
NewCops: enable

## sider's rubocop stops during this file
Rails/HttpStatus:
Exclude:
- 'app/controllers/application_controller.rb'

Rails/SkipsModelValidations:
AllowedMethods:
- 'touch'
- 'upsert_all'

Layout/LineLength:
Max: 200
Exclude:
- 'spec/**/*'
- 'config/**/*'

Layout/ParameterAlignment:
Enabled: false

Layout/EmptyLineBetweenDefs:
Enabled: false

Layout/EmptyLines:
Enabled: false

Layout/EmptyLinesAroundAccessModifier:
Enabled: false

Layout/EmptyLinesAroundBlockBody:
Enabled: false

Layout/EmptyLinesAroundClassBody:
Enabled: false

Layout/EmptyLinesAroundMethodBody:
Enabled: false

Layout/ExtraSpacing:
Enabled: false

Layout/IndentationConsistency:
Enabled: false

Layout/SpaceBeforeBlockBraces:
Enabled: false

Layout/SpaceInsideHashLiteralBraces:
Enabled: false

Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true

Layout/SpaceAroundMethodCallOperator:
Enabled: true

Lint/DeprecatedOpenSSLConstant:
Enabled: true

Lint/DuplicateElsifCondition:
Enabled: true

Lint/MixedRegexpCaptureTypes:
Enabled: true

Lint/RaiseException:
Enabled: true

Lint/StructNewOverride:
Enabled: true

Style/AsciiComments:
Enabled: false

Style/ClassAndModuleChildren:
Enabled: false

Style/Documentation:
Enabled: false

Style/EmptyMethod:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

Style/GuardClause:
Enabled: false

## Configuration parameters: Whitelist.
## Whitelist: be, be_a, be_an, be_between, be_falsey, be_kind_of, be_instance_of, be_truthy, be_within, eq, eql, end_with, include, match, raise_error, respond_to, start_with
Style/NumericPredicate:
Enabled: false

## Readability is more important
Style/RedundantReturn:
Enabled: false

Style/NumericLiterals:
Enabled: false

Style/AccessorGrouping:
Enabled: false

Style/ArrayCoercion:
Enabled: true

Style/BisectedAttrAccessor:
Enabled: true

Style/CaseLikeIf:
Enabled: true

Style/ExponentialNotation:
Enabled: true

Style/HashAsLastArrayItem:
Enabled: false

Style/HashEachMethods:
Enabled: true

Style/HashLikeCase:
Enabled: true

Style/HashTransformKeys:
Enabled: true

Style/HashTransformValues:
Enabled: true

Style/RedundantAssignment:
Enabled: true

Style/RedundantFetchBlock:
Enabled: true

Style/RedundantFileExtensionInRequire:
Enabled: true

Style/RedundantRegexpCharacterClass:
Enabled: true

Style/RedundantRegexpEscape:
Enabled: true

Style/SlicingWithRange:
Enabled: true

Style/TrailingCommaInHashLiteral:
Enabled: false

## Configuration parameters: EnforcedStyle, SupportedStyles.
## SupportedStyles: all_comparison_operators, equality_operators_only
Style/YodaCondition:
# Readability is more important
Enabled: false

Style/FormatStringToken:
EnforcedStyle: template

Performance/TimesMap:
Exclude:
- 'spec/**/*'

Metrics/BlockLength:
Exclude:
- 'spec/**/*'
- 'config/**/*'
- 'app/views/api/v1/**/*'
- 'app/models/order_product.rb' # aasm

Metrics/AbcSize:
Enabled: false

Metrics/MethodLength:
Enabled: false

Style/SymbolArray:
Enabled: false

Style/RescueModifier:
Enabled: false

Metrics/ClassLength:
Enabled: false

Metrics/ParameterLists:
Enabled: false

RSpec/NestedGroups:
Enabled: false

Capybara/CurrentPathExpectation:
Enabled: false

RSpec/MultipleMemoizedHelpers:
Enabled: false

RSpec/ExampleLength:
Enabled: false

RSpec/ContextWording:
Enabled: false

RSpec/MultipleExpectations:
Enabled: false

RSpec/LetSetup:
Enabled: false

RSpec/Capybara/FeatureMethods:
Enabled: false

RSpec/ChangeByZero:
Enabled: false

Naming/VariableNumber:
Enabled: false
Loading

0 comments on commit 46be958

Please sign in to comment.