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
Deprecate IgnoredPatterns
option in favor of the AllowedPatterns
options
#1336
Deprecate IgnoredPatterns
option in favor of the AllowedPatterns
options
#1336
Conversation
4db3706
to
c230622
Compare
rubocop/rubocop#10831 is required to resolve the build errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rubocop/rubocop#10831 is required to resolve the build errors.
Does it also mean that we should bump the minimum required version? The AllowedPatterns is available since 1.28 and we already depend on 1.31, but if deprecation is broken, perhaps we should wait for the next release and also add dependency on it?
@@ -778,9 +778,10 @@ RSpec/VariableName: | |||
SupportedStyles: | |||
- snake_case | |||
- camelCase | |||
AllowedPatterns: [] | |||
IgnoredPatterns: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we remove the obsolete configuration from the default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obsolete parameters are still available.
It seems to me that it would be better to keep both available for backward compatibility until the complete removal of the corresponding options at https://github.com/rubocop/rubocop, which will come someday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the meantime, is there a good way of suppressing this on every run?
Warning: obsolete parameter `IgnoredPatterns` (for `RSpec/VariableName`) found in vendor/bundle/ruby/3.1.0/gems/rubocop-rspec-2.13.2/config/default.yml
`IgnoredPatterns` has been renamed to `AllowedPatterns`.
Warning: obsolete parameter `IgnoredPatterns` (for `RSpec/VariableName`) found in .rubocop.yml
`IgnoredPatterns` has been renamed to `AllowedPatterns`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide .rubocop.yml?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warning: obsolete parameter `IgnoredPatterns` (for `RSpec/VariableName`) found in .rubocop.yml
`IgnoredPatterns` has been renamed to `AllowedPatterns`.
This warning can be suppressed by modifying .rubocop.yml as follows.
before
RSpec/VariableName:
IgnoredPatterns: [...]
after
RSpec/VariableName:
AllowedPatterns: [...]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warning: obsolete parameter `IgnoredPatterns` (for `RSpec/VariableName`) found in vendor/bundle/ruby/3.1.0/gems/rubocop-rspec-2.13.2/config/default.yml
`IgnoredPatterns` has been renamed to `AllowedPatterns`.
This is a guess, but I think the following settings may be included in the .rubocop.yml file.
inherit_from: vendor/bundle/ruby/3.1.0/gems/rubocop-rspec-2.13.2/config/default.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I get the warnings with our .rubocop.yml like:
inherit_gem:
rubocop-rspec:
- config/default.yml
require:
- rubocop-rspec
AllCops:
TargetRubyVersion: 3.1
NewCops: enable
I still get the warnings if I append this to the file -
RSpec/VariableName:
AllowedPatterns: []
However, looking into it - I'm not so sure we need the inherit_gem bit. Seems like if I remove it we still get the rspec defaults, but don't get the deprecation warnings.
Sorry for the noise!
Yes. That is the recognition. |
But it's not released yet. This is why Let's wait for the fix to be released and bump the dependency. |
c230622
to
bb9d2d9
Compare
Now we can incorporate this change: |
we should also bump the minimum required rubocop version |
c06a85e
to
8bd2838
Compare
IgnoredPatterns
optionIgnoredPatterns
option in favor of the AllowedPatterns
options
@Darhazer Sorry for the delay in responding. I updated this PR. |
8bd2838
to
b658493
Compare
…options Follow up rubocop/rubocop#10555 This PR obsoletes the `IgnoredPatterns` option and replaces it with the `AllowedPatterns` option.
b658493
to
7befba0
Compare
Follow up rubocop/rubocop#10555
This PR obsoletes the
IgnoredPatterns
option and replaces it with theAllowedPatterns
option.Before submitting the PR make sure the following are checked:
master
(if not - rebase it).CHANGELOG.md
if the new code introduces user-observable changes.bundle exec rake
) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).If you have created a new cop:
config/default.yml
.Enabled: pending
inconfig/default.yml
.Enabled: true
in.rubocop.yml
.VersionAdded
indefault/config.yml
to the next minor version.If you have modified an existing cop's configuration options:
VersionChanged
inconfig/default.yml
to the next major version.