diff --git a/CHANGELOG.md b/CHANGELOG.md index 11d7bd710..94a13961a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Master (Unreleased) +* Fix merging RSpec DSL configuration from third-party gems. ([@pirj][]) + ## 2.5.0 (2021-09-21) * Declare autocorrect as unsafe for `ExpectChange`. ([@francois-ferrandis][]) diff --git a/config/default.yml b/config/default.yml index 5f2dd7f99..1f3c5e94f 100644 --- a/config/default.yml +++ b/config/default.yml @@ -5,7 +5,20 @@ RSpec: - "**/*_spec.rb" - "**/spec/**/*" Language: + inherit_mode: + merge: + - Expectations + - Helpers + - Hooks + - HookScopes + - Runners + - Subjects ExampleGroups: + inherit_mode: + merge: + - Regular + - Skipped + - Focused Regular: - describe - context @@ -20,6 +33,12 @@ RSpec: - fcontext - ffeature Examples: + inherit_mode: + merge: + - Regular + - Skipped + - Focused + - Pending Regular: - it - specify @@ -62,6 +81,10 @@ RSpec: - all - suite Includes: + inherit_mode: + merge: + - Examples + - Context Examples: - it_behaves_like - it_should_behave_like @@ -73,6 +96,10 @@ RSpec: - to_not - not_to SharedGroups: + inherit_mode: + merge: + - Examples + - Context Examples: - shared_examples - shared_examples_for diff --git a/docs/modules/ROOT/pages/third_party_rspec_syntax_extensions.adoc b/docs/modules/ROOT/pages/third_party_rspec_syntax_extensions.adoc index 960a600b1..1b78f6d9d 100644 --- a/docs/modules/ROOT/pages/third_party_rspec_syntax_extensions.adoc +++ b/docs/modules/ROOT/pages/third_party_rspec_syntax_extensions.adoc @@ -8,6 +8,8 @@ RuboCop https://docs.rubocop.org/rubocop/configuration.html#inheriting-configura == Packaging configuration for RuboCop RSpec +NOTE: Due to a [bug](https://github.com/rubocop/rubocop-rspec/issues/1126), this feature doesn't work properly for `rubocop-rspec` 2.5.0 and earlier versions. + For a third-party gem, it's sufficient to follow three steps: 1. Provide a configuration file (e.g. `.rubocop_rspec_alias_config.yml` or `config/rubocop-rspec.yml`).