Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To avoid warning
Warning: Grep/Grep does not support Rules parameter.
Problem: warning message
Detail
This warning originates from the following section of rubocop/rubocop:
https://github.com/rubocop/rubocop/blob/f9b3b1ed1ddb6129cd5bf7c16824261041f107d5/lib/rubocop/config_validator.rb#L179-L204
Focusing on the
default_config.key?(param)
part, it seems that if the parameter in question exists in the default config (config/default.yml of each gem), the warning display can be prevented.Looking at how other gems handle this:
According to the comment in rubocop-grep at
rubocop-grep/lib/rubocop/grep/inject.rb
Line 3 in e750001
The
lib/rubocop/grep/inject.rb
is utilizinglib/rubocop/rspec/inject.rb
from rubocop-rspec.Rubocop-rspec defines additional parameters for each cop in
config/default.yml
.For example, the
RSpec/Dialect
has an additional parameter namedPreferredMethods
:https://github.com/rubocop/rubocop-rspec/blob/ecd945f5e49b6006c2a7f314d7570ed449afc6dc/config/default.yml#L301
Therefore, I considered resolving this by adding
Rules
as an additional parameter, similar toPreferredMethods: {}
.