reviewdog / action-languagetool

Run languagetool with reviewdog :dog:
https://github.com/marketplace?type=actions&query=reviewdog
MIT License
39 stars 20 forks source link

Argument list too long occurred when the file is exceed the limit. #32

Open kevindiu opened 3 years ago

kevindiu commented 3 years ago

In Vald project, we are using reviewdog to review our .md and .toml files. https://github.com/vdaas/vald/blob/master/.github/workflows/reviewdog-markdown.yml

But when we are using it, an error occurred and the CI failed with the following error message.

...
Checking .github/chatops_commands.md...
2021-09-28 07:34:09.490 +0000 INFO  org.languagetool.server.TextChecker Check done: 365 chars, en-US, requestId: null, #5, null, 0 matches, 84ms, agent:-, sent, q:0, h:1, dH:1, m:all
Checking CHANGELOG.md...
/entrypoint.sh: line 43: curl: Argument list too long
tmpl: EOF

https://github.com/vdaas/vald/pull/1450/checks?check_run_id=3751663477

As the error message shown, the error is caused by entrypoint.sh file. https://github.com/reviewdog/action-languagetool/blob/master/entrypoint.sh#L43-L48

I did some research about it, and it seems that the entire file content is sent from command line option. --data-urlencode "text=$(cat "${FILE}")" \

I think we can improve it by using @file instead of cat $FILE. e.g. --data-urlencode "text=@"${FILE}"" \ Ref: https://stackoverflow.com/questions/54090784/curl-argument-list-too-long

fmorett commented 1 year ago

+1