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
Lint/NonAtomicFileOperation
create broken code (else
without if
)
#10760
Labels
Comments
koic
added a commit
to koic/rubocop
that referenced
this issue
Jun 28, 2022
…tion` Fixes rubocop#10760. This PR fixes a false positive for `Lint/NonAtomicFileOperation` when using `FileTest.exist?` with `if` condition that has `else` branch.
8 tasks
bbatsov
pushed a commit
that referenced
this issue
Jun 28, 2022
Fixes #10760. This PR fixes a false positive for `Lint/NonAtomicFileOperation` when using `FileTest.exist?` with `if` condition that has `else` branch.
ShockwaveNN
changed the title
Jun 28, 2022
Lint/NonAtomicFileOperation
create broken code (else
without if
Lint/NonAtomicFileOperation
create broken code (else
without if
)
My case: FileUtils.rm_r project_name if Dir.exist? project_name Now causes offense. "Fix" without
|
Should I notify case with |
@AlexWayfer Try to add |
Doesn't help. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce the problem
test.rb
:rubocop -A test.rb
This is incorrect ruby code,
else
is missing it'sif
RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler.If you see extension cop versions (e.g.
rubocop-performance
,rubocop-rspec
, and others)output by
rubocop -V
, include them as well. Here's an example:The text was updated successfully, but these errors were encountered: