mpeterv / luacheck

A tool for linting and static analysis of Lua code.
MIT License
1.92k stars 322 forks source link

exit codes changes broke vim-syntastic integration #85

Closed thibaultcha closed 7 years ago

thibaultcha commented 7 years ago

TLDR: any chance there could be a release of the latest changes on master about exit codes?

Background:

I've been using vim-syntastic + luacheck for quite some time now, but the recent changes introduced in e3484ba5c1d8fadef16788129389b32da077598f broke the integration. Vim now prompts a buffer because syntastic thinks those exit codes are "abnormal":

syntastic: error: checker output:
Checking /Users/thibaultcha/git/lua-cassandra/lib/cassandra/cql2.lua 34 warnings
    /Users/thibaultcha/git/lua-cassandra/lib/cassandra/cql2.lua:3:7: unused variable 'bit'
    /Users/thibaultcha/git/lua-cassandra/lib/cassandra/cql2.lua:29:28: unused argument 'narr'
    [...]
Total: 34 warnings / 0 errors in 1 file
syntastic: error: checker lua/luacheck returned abnormal status 34
Press ENTER or type command to continue

I have seen discussions about dropping this behavior (imho, this is not very standard so I am glad), and that 9cd95a354a7829f6d5004a66309af6db04e65d27 reverts this behavior. I have tried the master branch locally and everything is back to normal again :) I might not be the only one experiencing this issue, so I think a release would be helpful.

Thanks!

mpeterv commented 7 years ago

Currently on master behaviour is not exactly reversed. In fact, it shouldn't work when syntax errors are present, assuming I'm understanding correctly that the checker expects 0, 1 or 2 as an exit code. I think I'll have to reverse it completely.

I'll check what plugins for other editors expect and see if I can retain some changes without breaking anything. Thanks for the report!

thibaultcha commented 7 years ago

Currently on master behaviour is not exactly reversed

That was my understanding as well, I should have used "reversed". Regardless, it works with the master branch, but I too think the behavior should be properly revert imho.

jmaygarden commented 7 years ago

I just hit this problem with 0.17.0 too. Reverted to 0.16.3.

mpeterv commented 7 years ago
  1. Syntastic checker expects 0, 1, or 2 as an exit code.
  2. Flycheck expects 0 if there are no warnings in the output, otherwise it doesn't seem to care.
  3. Sublimelinter does not seem to care.
  4. Atomlinter checker explicitly ignores exit codes.
  5. Brackets checker doesn't seem to care.
  6. VS Code checker doesn't seem to care.
mpeterv commented 7 years ago

I've reverted the changes on master.

thibaultcha commented 7 years ago

@mpeterv Good news! Thanks for addressing this :)