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

Add docs and provide a reference implementation on RSpec DSL aliases configuration in third-party gems #1077

Closed
3 of 4 tasks
pirj opened this issue Nov 6, 2020 · 0 comments · Fixed by #1097
Closed
3 of 4 tasks
Assignees

Comments

@pirj
Copy link
Member

pirj commented Nov 6, 2020

With #956 being released as part of RuboCop RSpec 2.0, this opens a possibility for third-party gems to supplement the default RSpec aliases configuration with those aliases that they introduce.

The purpose of this is to push the responsibility of configuring RSpec alias detection to third-party gems to avoid potential conflicts, avoid an excessive default list of aliases, and reduce the maintenance burden on us.

TODO:

  • provide a reference implementation in one of the repos
  • add docs on how third-party gems can provide their users that also use RuboCop RSpec with alias configuration they introduce

Notable examples are:

Proposed solution

https://docs.rubocop.org/rubocop/1.2/configuration.html#inheriting-configuration-from-a-dependency-gem

Third party gem's rubocop_rspec_alias_config.yml:

RSpec:
  Language:
    Includes:
      Examples:
        - is_able_to

Third-party gem's README.md:

## Usage with RuboCop RSpec

Please add the following to your `.rubocop.yml`:
----
inherit_gem:
  third-party-gem: rubocop_rspec_alias_config.yml
----

And update your `gemspec` file to include `rubocop_rspec_alias_config.yml` in `spec.files`.

Source of infromation: #333

@pirj pirj self-assigned this Nov 6, 2020
pirj added a commit to pirj/action_policy that referenced this issue Nov 8, 2020
Previously, RuboCop RSpec failed to detect RSpec aliases. A number of
cops were failing false offences, and some cops were unable to lint, as
they were skipping locally defined RSpec aliases taking them for
arbitrary blocks and method calls.

See:
 - rubocop/rubocop-rspec#1077
 - rubocop/rubocop-rspec#956
 - palkan#103
pirj added a commit to pirj/action_policy that referenced this issue Nov 8, 2020
Previously, RuboCop RSpec failed to detect RSpec aliases. A number of
cops were failing false offences, and some cops were unable to lint, as
they were skipping locally defined RSpec aliases taking them for
arbitrary blocks and method calls.

See:
 - rubocop/rubocop-rspec#1077
 - rubocop/rubocop-rspec#956
 - palkan#103
@bquorning bquorning changed the title Add docs and provide a reference implementation on RSpec DSL aliases configuration in thrid-party gems Add docs and provide a reference implementation on RSpec DSL aliases configuration in third-party gems Nov 8, 2020
pirj added a commit to pirj/test-prof that referenced this issue Nov 9, 2020
Previously, RuboCop RSpec failed to detect RSpec aliases. A number of
cops were failing false offences, and some cops were unable to lint, as
they were skipping locally defined RSpec aliases taking them for
arbitrary blocks and method calls.

See:
 - rubocop/rubocop-rspec#1077
 - rubocop/rubocop-rspec#956

Sibling pull requests:
 - palkan/action_policy#138
pirj added a commit to pirj/test-prof that referenced this issue Nov 9, 2020
Previously, RuboCop RSpec failed to detect RSpec aliases. A number of
cops were failing false offences, and some cops were unable to lint, as
they were skipping locally defined RSpec aliases taking them for
arbitrary blocks and method calls.

See:
 - rubocop/rubocop-rspec#1077
 - rubocop/rubocop-rspec#956

Sibling pull requests:
 - palkan/action_policy#138
pirj added a commit to pirj/test-prof that referenced this issue Nov 9, 2020
Previously, RuboCop RSpec failed to detect RSpec aliases. A number of
cops were failing false offences, and some cops were unable to lint, as
they were skipping locally defined RSpec aliases taking them for
arbitrary blocks and method calls.

See:
 - rubocop/rubocop-rspec#1077
 - rubocop/rubocop-rspec#956

Sibling pull requests:
 - palkan/action_policy#138
pirj added a commit to pirj/action_policy that referenced this issue Nov 17, 2020
Previously, RuboCop RSpec failed to detect RSpec aliases. A number of
cops were failing false offences, and some cops were unable to lint, as
they were skipping locally defined RSpec aliases taking them for
arbitrary blocks and method calls.

See:
 - rubocop/rubocop-rspec#1077
 - rubocop/rubocop-rspec#956
 - palkan#103
pirj added a commit to pirj/test-prof that referenced this issue Nov 17, 2020
Previously, RuboCop RSpec failed to detect RSpec aliases. A number of
cops were failing false offences, and some cops were unable to lint, as
they were skipping locally defined RSpec aliases taking them for
arbitrary blocks and method calls.

See:
 - rubocop/rubocop-rspec#1077
 - rubocop/rubocop-rspec#956

Sibling pull requests:
 - palkan/action_policy#138
palkan pushed a commit to palkan/action_policy that referenced this issue Nov 18, 2020
Previously, RuboCop RSpec failed to detect RSpec aliases. A number of
cops were failing false offences, and some cops were unable to lint, as
they were skipping locally defined RSpec aliases taking them for
arbitrary blocks and method calls.

See:
 - rubocop/rubocop-rspec#1077
 - rubocop/rubocop-rspec#956
 - #103
pirj added a commit to pirj/test-prof that referenced this issue Nov 18, 2020
Previously, RuboCop RSpec failed to detect RSpec aliases. A number of
cops were failing false offences, and some cops were unable to lint, as
they were skipping locally defined RSpec aliases taking them for
arbitrary blocks and method calls.

See:
 - rubocop/rubocop-rspec#1077
 - rubocop/rubocop-rspec#956

Sibling pull requests:
 - palkan/action_policy#138
palkan pushed a commit to test-prof/test-prof that referenced this issue Nov 18, 2020
Previously, RuboCop RSpec failed to detect RSpec aliases. A number of
cops were failing false offences, and some cops were unable to lint, as
they were skipping locally defined RSpec aliases taking them for
arbitrary blocks and method calls.

See:
 - rubocop/rubocop-rspec#1077
 - rubocop/rubocop-rspec#956

Sibling pull requests:
 - palkan/action_policy#138
pirj added a commit that referenced this issue Nov 18, 2020
pirj added a commit that referenced this issue Nov 18, 2020
pirj added a commit that referenced this issue Nov 18, 2020
pirj added a commit that referenced this issue Nov 18, 2020
pirj added a commit that referenced this issue Nov 18, 2020
pirj added a commit that referenced this issue Nov 18, 2020
pirj added a commit that referenced this issue Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant