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
Using the --fix
option with --stdin
appends file content to the json result
#8673
Comments
8 tasks
koic
added a commit
to koic/rubocop
that referenced
this issue
Sep 14, 2020
…=json` and `--stdin` Fixes rubocop#8673. This PR returns only JSON result when specifying `--format=json` and `--stdin` to fix the JSON parse error. Similar HTML and JUnit formatters are targeted as well.
bbatsov
pushed a commit
that referenced
this issue
Sep 14, 2020
…and `--stdin` Fixes #8673. This PR returns only JSON result when specifying `--format=json` and `--stdin` to fix the JSON parse error. Similar HTML and JUnit formatters are targeted as well.
nice fix but breaking change for other tools that were somehow dealing with the "bugged" output (ruby-rubocop vs-code extension as an example) |
That's unfortunate, but I guess it won't be a hard to adjust the VS Code extension. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I run
rubocop
using--fix
and--stdin
flags, I can see that the content of the file is appended to the JSON result.This prevent tools (like RubyMine) to parse the response (https://youtrack.jetbrains.com/issue/RUBY-27006)
Expected behavior
I would expect to have only the JSON result.
Actual behavior
Example:
Steps to reproduce the problem
Just run the following in a Rails project:
rubocop --format json --force-exclusion --fix --stdin application_controller.rb < app/controllers/application_controller.rb
RuboCop version
The text was updated successfully, but these errors were encountered: