Open Kamilcuk opened 3 months ago
I am still getting the same error with 0.10.0. Anything you might recommend? This is workflow file:
jobs:
format:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ....rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt
- uses: ....rustfmt-check@0.10.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
mode: review
I'm trying to reproduce this with a test that outputs a very large JSON, but I can't reproduce the error. Is there anything that you share that might help me reproduce this, so I can attempt to fix it?
I am running the action on our enterprise against our private repo. The result in github actions window is a long json follows by a
Unexpected end of JSON input
message.I have confirmed mulitple times that the string
[{"name":"/_work/avt-runner-..............);\n"}]}]
is a valid JSON. The JSON has 18938 bytes.Looking at the source code, I see the following https://github.com/mbrobbel/rustfmt-check/blob/master/src/check.ts#L42 . Most probably 19000 bytes is more than output buffering, so I suspect what actually happens, is that only part of the JSON, most probably 16384 bytes, goes into
add
function. Because it is not a full message,add
is not able to parse the full JSON.Could this be changed into buffering, like https://github.com/mbrobbel/rustfmt-check/blob/master/src/rustfmt.ts#L18? Does fixing it to the following would work?
Thanks