Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inherit_mode for third-party gems #1192

Merged
merged 1 commit into from Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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