142 lines
3.1 KiB
YAML
142 lines
3.1 KiB
YAML
# We need to ignore exclusions defined in parent RuboCop configuration
|
|
# (AllCops/Exclude: 'gems/**/*') if RuboCop cop is run within `gems/...`.
|
|
# See https://gitlab.com/gitlab-org/gitlab/-/issues/417281
|
|
<%
|
|
relative_path = ENV['PWD'].delete_prefix(File.expand_path('../..'))
|
|
RuboCop::ConfigLoader.ignore_parent_exclusion = relative_path.start_with?('/gems/')
|
|
%>
|
|
---
|
|
inherit_gem:
|
|
gitlab-styles:
|
|
- rubocop-default.yml
|
|
|
|
require:
|
|
- ../../rubocop/rubocop
|
|
- rubocop-rspec
|
|
|
|
inherit_mode:
|
|
merge:
|
|
- Include
|
|
- Exclude
|
|
- AllowedPatterns
|
|
|
|
AllCops:
|
|
# The oldest supported Ruby version.
|
|
TargetRubyVersion: 3.1
|
|
SuggestExtensions: false
|
|
NewCops: disable
|
|
|
|
# This cop doesn't make sense in the context of gems
|
|
CodeReuse/ActiveRecord:
|
|
Enabled: false
|
|
|
|
# This cop doesn't make sense in the context of gems
|
|
RSpec/FactoriesInMigrationSpecs:
|
|
Enabled: false
|
|
|
|
# This cop doesn't make sense in the context of gems
|
|
Cop/PutGroupRoutesUnderScope:
|
|
Enabled: false
|
|
|
|
# This cop doesn't make sense in the context of gems
|
|
Cop/PutProjectRoutesUnderScope:
|
|
Enabled: false
|
|
|
|
Gemspec/AvoidExecutingGit:
|
|
Enabled: true
|
|
|
|
# We disable this since we support multiple Ruby versions
|
|
Gemspec/RequiredRubyVersion:
|
|
Enabled: false
|
|
|
|
# This cop enforces domain bounded contexts which generally
|
|
# are not applicable to gems.
|
|
Gitlab/BoundedContexts:
|
|
Enabled: false
|
|
|
|
# This cop doesn't make sense in the context of gems
|
|
Gitlab/DocUrl:
|
|
Enabled: false
|
|
|
|
# This cop doesn't make sense in the context of gems
|
|
Gitlab/NamespacedClass:
|
|
Enabled: false
|
|
|
|
# This cop doesn't make sense in the context of gems
|
|
Gitlab/RSpec/AvoidSetup:
|
|
Enabled: false
|
|
|
|
# This cop doesn't make sense in the context of gems
|
|
Graphql/AuthorizeTypes:
|
|
Enabled: false
|
|
|
|
Gitlab/Json:
|
|
Enabled: false
|
|
|
|
# This cop doesn't make sense in the context of gems
|
|
Graphql/Descriptions:
|
|
Enabled: false
|
|
|
|
# This cop doesn't make sense in the context of gems
|
|
RSpec/BeforeAll:
|
|
Enabled: false
|
|
|
|
Naming/FileName:
|
|
Exclude:
|
|
- spec/**/*.rb
|
|
|
|
# Include behavior not honored. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145865/diffs#note_1791901400
|
|
Rails/MigrationTimestamp:
|
|
Enabled: false
|
|
|
|
# This cop doesn't make sense in the context of gems
|
|
RSpec/AvoidConditionalStatements:
|
|
Enabled: false
|
|
|
|
RSpec/ContextWording:
|
|
Prefixes:
|
|
- 'when'
|
|
- 'with'
|
|
- 'without'
|
|
- 'for'
|
|
- 'and'
|
|
- 'on'
|
|
- 'in'
|
|
- 'as'
|
|
- 'if'
|
|
|
|
# This cop doesn't make sense in the context of gems
|
|
RSpec/FeatureCategory:
|
|
Enabled: false
|
|
|
|
Style/InlineDisableAnnotation:
|
|
Enabled: false
|
|
|
|
Style/Lambda:
|
|
EnforcedStyle: literal
|
|
|
|
Style/RegexpLiteralMixedPreserve:
|
|
Enabled: true
|
|
SupportedStyles:
|
|
- slashes
|
|
- percent_r
|
|
- mixed
|
|
- mixed_preserve
|
|
EnforcedStyle: mixed_preserve
|
|
|
|
# Short-hand Hash syntax does not work prior 3.1.
|
|
# See https://gitlab.com/gitlab-org/gitlab/-/issues/435940#note_1703307479
|
|
Style/HashSyntax:
|
|
EnforcedShorthandSyntax: never
|
|
|
|
# This cop doesn't make sense in the context of gems
|
|
Migration/EnsureFactoryForTable:
|
|
Enabled: false
|
|
|
|
# This cop doesn't make sense in the context of gems unless they're
|
|
# adding Controller code
|
|
Rails/StrongParams:
|
|
Enabled: true
|
|
Include:
|
|
- '**/controllers/**/*'
|