Skip to content

Commit

Permalink
Merge pull request #1192 from rubocop/fix-rspec-dsl-for-third-party-gems
Browse files Browse the repository at this point in the history
Fix inherit_mode for third-party gems
  • Loading branch information
pirj committed Oct 5, 2021
2 parents d73d80b + f663fdc commit 5f21458
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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][])
Expand Down
27 changes: 27 additions & 0 deletions config/default.yml
Expand Up @@ -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
Expand All @@ -20,6 +33,12 @@ RSpec:
- fcontext
- ffeature
Examples:
inherit_mode:
merge:
- Regular
- Skipped
- Focused
- Pending
Regular:
- it
- specify
Expand Down Expand Up @@ -62,6 +81,10 @@ RSpec:
- all
- suite
Includes:
inherit_mode:
merge:
- Examples
- Context
Examples:
- it_behaves_like
- it_should_behave_like
Expand All @@ -73,6 +96,10 @@ RSpec:
- to_not
- not_to
SharedGroups:
inherit_mode:
merge:
- Examples
- Context
Examples:
- shared_examples
- shared_examples_for
Expand Down
Expand Up @@ -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`).
Expand Down

0 comments on commit 5f21458

Please sign in to comment.