# rubocop yml config example # https://github.com/ryshinoz/rubocop_sample require: - rubocop-rails - rubocop-performance ######## Rubocop Config ######## AllCops: Exclude: - vendor/**/* - db/**/* - config/**/* - tmp/**/* - log/**/* TargetRubyVersion: 2.7 # NOTE 4 系を利用している場合は書き換える TargetRailsVersion: 5.0 NewCops: enable Style/AndOr: Enabled: false Style/CommentAnnotation: Enabled: false Layout/ParameterAlignment: EnforcedStyle: with_fixed_indentation Layout/CaseIndentation: EnforcedStyle: end Layout/FirstHashElementIndentation: Enabled: false Layout/IndentationWidth: Enabled: false Layout/MultilineOperationIndentation: Enabled: false Layout/SpaceBeforeBlockBraces: EnforcedStyle: space Layout/SpaceInsideBlockBraces: EnforcedStyle: space SpaceBeforeBlockParameters: false Layout/SpaceInsideHashLiteralBraces: EnforcedStyle: no_space # NOTE チームで推奨しているスタイルを差異があるため Layout/BlockAlignment: Enabled: false Layout/EndAlignment: Enabled: false Lint/UnderscorePrefixedVariableName: Enabled: false Lint/AmbiguousBlockAssociation: Exclude: - "spec/**/*" Lint/AssignmentInCondition: Enabled: false Lint/UnusedBlockArgument: Enabled: true Lint/UnusedMethodArgument: Enabled: true Lint/UselessAssignment: Enabled: true Lint/BinaryOperatorWithIdenticalOperands: Enabled: true Lint/Void: Enabled: true Metrics/AbcSize: Max: 1000 Metrics/BlockLength: Max: 150 CountComments: false # NOTE RSpec のブロックは長くなるため Exclude: - "**/*_spec.rb" - "spec/support/*.rb" Metrics/ClassLength: Max: 1000 Metrics/CyclomaticComplexity: Max: 50 Layout/LineLength: Enabled: false Metrics/MethodLength: Enabled: false Metrics/PerceivedComplexity: Exclude: - "**/*_spec.rb" - "spec/support/*.rb" Naming/PredicateName: Enabled: false Naming/VariableNumber: EnforcedStyle: snake_case Style/NumericLiterals: MinDigits: 12 Performance/RedundantMatch: Enabled: false Rails: Enabled: true Rails/ActionFilter: Enabled: false Rails/Delegate: Enabled: true Rails/HttpPositionalArguments: Enabled: false Rails/Validation: Enabled: true Style/RedundantSelf: Enabled: false Style/AsciiComments: Enabled: false Style/BlockDelimiters: Enabled: false Style/CaseEquality: Enabled: false Style/ClassAndModuleChildren: Enabled: false Style/CollectionMethods: Enabled: false Style/Documentation: Enabled: false Style/EmptyLiteral: Enabled: false Style/GuardClause: MinBodyLength: 3 Style/Lambda: Enabled: false Style/Next: EnforcedStyle: skip_modifier_ifs MinBodyLength: 10 Style/MultilineBlockChain: Enabled: false # NOTE () で統一していたため [] への変更はしない Style/PercentLiteralDelimiters: PreferredDelimiters: default: () '%': '||' '%r': '{}' '%w': '()' '%W': '()' '%i': '()' '%I': '()' Style/Proc: Enabled: false Style/Semicolon: Enabled: false Style/SignalException: EnforcedStyle: only_raise Style/TrailingUnderscoreVariable: Enabled: false Style/WhenThen: Enabled: false Style/SingleLineMethods: Enabled: false Style/MethodCallWithoutArgsParentheses: Enabled: true Style/DefWithParentheses: Enabled: true