tomtom / checksyntax_vim

Check a file's syntax when saving a file (php, ruby, tex ...) with vim
http://www.vim.org/scripts/script.php?script_id=1431
GNU General Public License v3.0
94 stars 9 forks source link

Add custom syntax checking or multiple checkers #15

Closed fidian closed 12 years ago

fidian commented 12 years ago

I would like to run my javascript through jsl and jslint and potentially other tools to look for duplicated code and other violations. I could write up a shell script to provide all of the errors in one screen for inclusion into checksyntax, but how would I say that the JS syntax checker to run is now /home/fidian/bin/syntax_js and that the return code should be used for success / failure?

tomtom commented 12 years ago

If the output of the script doesn't include any lines that match efm, checksyntax assumes there were no errors/warnings. I thus think simply concatenating the output of those tools should work. There is currently no way to determine success/failure on bases of the return code since success is defined as no messages about errors or warnings.

I like the idea of running multiple tools though. Maybe I'll integrate that approach somehow.

fidian commented 12 years ago

I'd be happy to write out a specific message if that would help, such as "Errors Found! OMG!" or maybe less wacky. I'm not tied to using the return code of the command, though I do find it odd that the return code isn't something that could signify that errors were found.

tomtom commented 12 years ago

I think the major challenge with such a script would be that all syntax checkers have to return uniform error messages in the same format. If you can get them to do that it is not necessary to check if there were no (= zero) errors, i.e. if the checks succeeded.

IMHO the better solution would be to make checksyntax handle all those syntax checkers. You'd have to wait some weeks though for me to implement that -- depending on the weather. :-)