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: Lint/RedundantDirGlobSort unset SafeAutoCorrect #10446
Conversation
dc1570c
to
04d4ea8
Compare
This also has to be documented within the cop as in https://docs.rubocop.org/rubocop/1.25/cops_lint.html#safety |
04d4ea8
to
4d40516
Compare
@@ -2013,6 +2013,7 @@ Lint/RedundantDirGlobSort: | |||
Description: 'Checks for redundant `sort` method to `Dir.glob` and `Dir[]`.' | |||
Enabled: pending | |||
VersionAdded: '1.8' |
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 insert VersionChanged: '<<next>>'
?
VersionAdded: '1.8' | |
VersionAdded: '1.8' | |
VersionChanged: '<<next>>' |
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.
Updated, thank you
4d40516
to
db8d2e2
Compare
I still don't see a "Safety" section in the cop docs after your updates. |
347a1a5
to
18c0016
Compare
@bbatsov sorry, missed that, my first open-source contribution. Docs updated accordingly. |
Please edit |
18c0016
to
e1cb220
Compare
@koic thank you, done 🙏🏻 |
e1cb220
to
8c9ca4a
Compare
Thanks! |
Why:
Lint/RedundantDirGlobSort
Cop is not safe.Removing
.sort
breaks on Ruby 3.0 withDirGlob
please refer this repo for demo of this issue
What:
config/default.yml
to setLint/RedundantDirGlobSort
as NOT asSafeAutoCorrect
No related GitHub issue found.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.