diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-21 21:10:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-21 21:10:44 +0300 |
commit | 136ec65df5255512264ef62e9ad5561e5f85a735 (patch) | |
tree | b21f397fa036fb63d868da97b99c920db9b9900a /spec/rubocop_spec_helper.rb | |
parent | e87220d9c1a7878a4cb2bb86554c5951371e340b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/rubocop_spec_helper.rb')
-rw-r--r-- | spec/rubocop_spec_helper.rb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/spec/rubocop_spec_helper.rb b/spec/rubocop_spec_helper.rb index a37415a25de..cf747132ec1 100644 --- a/spec/rubocop_spec_helper.rb +++ b/spec/rubocop_spec_helper.rb @@ -8,13 +8,23 @@ require 'fast_spec_helper' require 'rubocop' require 'rubocop/rspec/support' -RSpec.configure do |config| - config.include RuboCop::RSpec::ExpectOffense, type: :rubocop +require_relative './support/shared_contexts/rubocop_default_rspec_language_config_context' +RSpec.configure do |config| config.define_derived_metadata(file_path: %r{spec/rubocop}) do |metadata| - metadata[:type] = :rubocop + # TODO: move DuplicateSpecLocation cop to RSpec::DuplicateSpecLocation + unless metadata[:type] == :rubocop_rspec + metadata[:type] = :rubocop + end end - # Include config shared context for all cop specs. + config.define_derived_metadata(file_path: %r{spec/rubocop/cop/rspec}) do |metadata| + metadata[:type] = :rubocop_rspec + end + + config.include RuboCop::RSpec::ExpectOffense, type: :rubocop + config.include RuboCop::RSpec::ExpectOffense, type: :rubocop_rspec + config.include_context 'config', type: :rubocop + config.include_context 'with default RSpec/Language config', type: :rubocop_rspec end |