We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Specifically, when using File.open. With this code:
File.open(path) { |f| f.read }
the Style/SymbolProc cop fails thusly:
C: Style/SymbolProc: Pass &:read as an argument to open instead of a block. File.open(path) { |f| f.read } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
However with the suggested code:
File.open(path, &:read)
the Style/AutoResourceCleanup cop fails:
C: Style/AutoResourceCleanup: Use the block version of File.open. File.open(path, &:read) ^^^^^^^^^^^^^^^^^^^^^^^
I believe this is due to the change to Style/SymbolProc after which that cop now applies to methods that take parameters.
The text was updated successfully, but these errors were encountered:
e929a91
Merge pull request #2249 from lumeet/2248_auto_resource_cleanup_block…
75cf9de
…_pass [Fix #2248] Allow AutoResourceCleanup block-pass
No branches or pull requests
Specifically, when using File.open. With this code:
the Style/SymbolProc cop fails thusly:
However with the suggested code:
the Style/AutoResourceCleanup cop fails:
C: Style/AutoResourceCleanup: Use the block version of File.open. File.open(path, &:read) ^^^^^^^^^^^^^^^^^^^^^^^
I believe this is due to the change to Style/SymbolProc after which that cop now applies to methods that take parameters.
The text was updated successfully, but these errors were encountered: