-
Notifications
You must be signed in to change notification settings - Fork 213
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
Not making fixes in stdout when using parallel: true #536
Comments
I was able to quickly reproduce this issue. Weirdly, I'd already stumbled on this issue and even commented on it—but I mistakenly assumed that this only affected Finding that comment was a great help, since it pointed me to the exact line that breaks things: def run(paths)
target_files = find_target_files(paths)
if @options[:list_target_files]
list_files(target_files)
else
warm_cache(target_files) if @options[:parallel] #<--- This one!
inspect_files(target_files)
end
#…
end That's as far as I've gotten so far, but wanted to document that much. Next step is to look into what the |
One layer deeper, the error seems to be occurring because of this def warm_cache(target_files)
saved_options = @options.dup #<-- This right here
if target_files.length <= 1
puts 'Skipping parallel inspection: only a single file needs inspection' if @options[:debug]
return
end
puts 'Running parallel inspection' if @options[:debug]
%i[autocorrect safe_autocorrect].each { |opt| @options[opt] = false }
Parallel.each(target_files) { |target_file| file_offenses(target_file) }
ensure
@options = saved_options
end My test passes when I simply replace |
Woops, nevermind I was wrong when I said this:
Past me was right. This only affects stdin. Today I had forgotten that the test cases that call through to the CLI are doing so under stdin. Plain ol' parallel works fine; only stdin fails. To be honest, does parallel even make sense over stdin? It only supports one path at a time. Seems more reasonable to just strip out the |
This should be fixed in 1.25.1. |
Thanks @searls! |
I'm attempting to use standard in Neovim (through Mason -> null-ls.nvim, but that probably doesn't matter). When I try to have it format my file, it does nothing. In the logs, there's a message "buffer unchanged", and poking at it, it seems like standard is outputting the original version of the file, instead of the one it fixed. I've extracted the commands it runs, and here's the equivalent command and its output (truncated for simplicity):
It detected the single-quoted string and says it corrected it, but the output on stdout is the original file, with single-quoted
'pgcrypto'
unchanged.If I do the equivalent thing in rubocop, it outputs the fixes, like I'd expect:
This project does have a
.standard.yml
file in it, with the following contents:I tried removing each of them, and discovered if I removed
parallel: true
, it works. Leaving the others in there doesn't impact the output:This might be the same issue as #530?
Versions:
The text was updated successfully, but these errors were encountered: