summaryrefslogtreecommitdiff
path: root/.rubocop.yml
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-12-20 14:22:11 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-12-20 14:22:11 +0000
commit0c872e02b2c822e3397515ec324051ff540f0cd5 (patch)
treece2fb6ce7030e4dad0f4118d21ab6453e5938cdd /.rubocop.yml
parentf7e05a6853b12f02911494c4b3fe53d9540d74fc (diff)
downloadgitlab-ce-0c872e02b2c822e3397515ec324051ff540f0cd5.tar.gz
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to '.rubocop.yml')
-rw-r--r--.rubocop.yml67
1 files changed, 46 insertions, 21 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index d0cf328e719..3a3150f9fbc 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -49,10 +49,20 @@ AllCops:
- 'db/ci_migrate/*.rb' # since the `db/ci_migrate` is a symlinked to `db/migrate`
# Use absolute path to avoid orphan directories with changed workspace root.
CacheRootDirectory: <%= Dir.getwd %>/tmp
- MaxFilesInCache: 35000
+ MaxFilesInCache: 1_000_000
NewCops: disable
SuggestExtensions: false
+Rails:
+ Exclude:
+ # User defined excludes on top (department) level don't cancel default
+ # includes set by child cops. Directories below are not affected (tested
+ # manually). Watch https://github.com/rubocop/rubocop/issues/11148 to
+ # know when this comment can be removed.
+ - 'danger/**/*'
+ - 'tooling/danger/**/*'
+ - 'rubocop/**/*'
+
RSpec:
Language:
Includes:
@@ -159,6 +169,7 @@ Naming/FileName:
- 'qa/tasks/**/*.rake'
- '**/*.ru'
- 'app/graphql/types/issue_connection.rb'
+ - 'app/graphql/types/group_connection.rb'
IgnoreExecutableScripts: true
AllowedAcronyms:
@@ -272,10 +283,6 @@ Rails/FindBy:
- 'spec/**/*.rb'
- 'ee/spec/**/*.rb'
-Rails/IndexBy:
- Exclude:
- - 'tooling/danger/**/*.rb'
-
Rails/InverseOf:
Include:
- app/models/**/*.rb
@@ -299,6 +306,10 @@ Rails/MailerName:
# See for the context on why it's excluded https://gitlab.com/gitlab-org/gitlab/-/issues/239356#note_956419227
- 'app/mailers/notify.rb'
+Rails/Pluck:
+ # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/94047#note_1179689274
+ AutoCorrect: false
+
Rails/RakeEnvironment:
# Context on why it's disabled: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/93419#note_1048223982
Enabled: false
@@ -399,6 +410,12 @@ Database/MultipleDatabases:
- 'spec/lib/gitlab/background_migration/**/*.rb'
- 'spec/lib/gitlab/database/**/*.rb'
+Migration/BatchMigrationsPostOnly:
+ Enabled: true
+ Include:
+ - 'db/migrate/*.rb'
+ - 'db/post_migrate/*.rb'
+
# See https://gitlab.com/gitlab-org/gitlab/-/issues/373194
Gitlab/RSpec/AvoidSetup:
Enabled: true
@@ -440,22 +457,6 @@ Cop/ActiveModelErrorsDirectManipulation:
Gitlab/AvoidFeatureGet:
Enabled: true
-RSpec/TimecopFreeze:
- Enabled: true
- AutoCorrect: true
- Include:
- - 'spec/**/*.rb'
- - 'ee/spec/**/*.rb'
- - 'qa/spec/**/*.rb'
-
-RSpec/TimecopTravel:
- Enabled: true
- AutoCorrect: true
- Include:
- - 'spec/**/*.rb'
- - 'ee/spec/**/*.rb'
- - 'qa/spec/**/*.rb'
-
RSpec/WebMockEnable:
Enabled: true
Include:
@@ -474,6 +475,14 @@ Naming/PredicateName:
Naming/RescuedExceptionsVariableName:
Enabled: false
+RSpec/AvoidTestProf:
+ Include:
+ - 'spec/migrations/**/*.rb'
+ - 'ee/spec/migrations/**/*.rb'
+ - 'spec/lib/gitlab/background_migration/**/*.rb'
+ - 'ee/spec/lib/gitlab/background_migration/**/*.rb'
+ - 'ee/spec/lib/ee/gitlab/background_migration/**/*.rb'
+
RSpec/FactoriesInMigrationSpecs:
Enabled: true
Include:
@@ -488,8 +497,16 @@ RSpec/FactoryBot/AvoidCreate:
Include:
- 'spec/presenters/**/*.rb'
- 'spec/serializers/**/*.rb'
+ - 'spec/helpers/**/*.rb'
+ - 'spec/views/**/*.rb'
+ - 'spec/components/**/*.rb'
+ - 'spec/mailers/**/*.rb'
- 'ee/spec/presenters/**/*.rb'
- 'ee/spec/serializers/**/*.rb'
+ - 'ee/spec/helpers/**/*.rb'
+ - 'ee/spec/views/**/*.rb'
+ - 'ee/spec/components/**/*.rb'
+ - 'ee/spec/mailers/**/*.rb'
RSpec/FactoryBot/StrategyInCallback:
Enabled: true
@@ -886,3 +903,11 @@ Rake/Require:
Include:
- '{,ee/,jh/}lib/**/*.rake'
- 'qa/tasks/**/*.rake'
+
+Cop/FeatureFlagUsage:
+ Include:
+ - 'lib/gitlab/redis/**/*.rb'
+ - 'lib/gitlab/patch/**/*.rb'
+ - 'lib/gitlab/instrumentation/**/*.rb'
+ Exclude:
+ - 'lib/gitlab/redis/multi_store.rb'