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
Enhance the autocorrect for Style/FetchEnvVar
#10585
Changes from 1 commit
41b8400
fa5557e
3797914
214f6f0
8f94017
7392eda
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#10585](https://github.com/rubocop/rubocop/pull/10585): Enhance the autocorrect for `RSpec/FetchEnvVar`. ([@johnny-miyake][]) | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3538,6 +3538,9 @@ Style/FetchEnvVar: | |
VersionAdded: '1.28' | ||
# Environment variables to be excluded from the inspection. | ||
AllowedVars: [] | ||
# - `SecondArgOfFetch` puts the RHS to the second argument of `ENV.fetch`. (default) | ||
# - `BlockContent` puts the RHS into a block. | ||
BasicLiteralRhs: 'SecondArgOfFetch' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems to me that adds extra complexity for the end users - I generally don't see why someone would want to put basic literals in a block, as there are no performance gains for this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for your point. If the option doesn't have much benefit for most people, I'm willing to remove it as the less code or options, the better. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed. I'm of the "less is more" school of thought, so I prefer to add options only when there's some demand for them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's true. I removed the option. 3797914 |
||
|
||
Style/FileRead: | ||
Description: 'Favor `File.(bin)read` convenience methods.' | ||
|
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.
RSpec? :-)
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.
Oops, thanks!