Skip to content

Commit

Permalink
Merge pull request #1459 from rubocop/make-runners-and-hook-scopes-no…
Browse files Browse the repository at this point in the history
…n-configurable

Make hook scopes and runners non-configurable
  • Loading branch information
pirj authored Nov 3, 2022
2 parents c55aaac + 744918d commit 6e50e06
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Fix `RSpec/FactoryBot/ConsistentParenthesesStyle` to ignore calls without the first positional argument. ([@pirj])
- Fix `RSpec/FactoryBot/ConsistentParenthesesStyle` to ignore calls inside a Hash or an Array. ([@pirj])
- Fix `RSpec/NestedGroups` to correctly use `AllowedGroups` config. ([@samrjenkins])
- Remove `Runners` and `HookScopes` RSpec DSL elements from configuration. ([@pirj])

## 2.14.2 (2022-10-25)

Expand Down
12 changes: 0 additions & 12 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ RSpec:
- Expectations
- Helpers
- Hooks
- HookScopes
- Runners
- Subjects
ExampleGroups:
inherit_mode:
Expand Down Expand Up @@ -81,12 +79,6 @@ RSpec:
- prepend_after
- after
- append_after
HookScopes:
- each
- example
- context
- all
- suite
Includes:
inherit_mode:
merge:
Expand All @@ -98,10 +90,6 @@ RSpec:
- include_examples
Context:
- include_context
Runners:
- to
- to_not
- not_to
SharedGroups:
inherit_mode:
merge:
Expand Down
6 changes: 4 additions & 2 deletions lib/rubocop/rspec/language.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ def self.all(element)
end

module HookScopes # :nodoc:
ALL = %i[each example context all suite].freeze
def self.all(element)
Language.config['HookScopes'].include?(element.to_s)
ALL.include?(element)
end
end

Expand All @@ -158,8 +159,9 @@ def context(element)
end

module Runners # :nodoc:
ALL = %i[to to_not not_to].freeze
def self.all(element)
Language.config['Runners'].include?(element.to_s)
ALL.include?(element)
end
end

Expand Down

0 comments on commit 6e50e06

Please # to comment.