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

Perl syntax checker should not check for warnings #27

Closed scottchiefbaker closed 9 years ago

scottchiefbaker commented 9 years ago

Currently checksyntax calls perl -Wc % to check the syntax of a buffer. If that buffer includes a use statement to include a global library, the check extends to also include that library. From the perlrun manpage:

       -c   causes Perl to check the syntax of the program and then exit without executing it.  [snipped]

       -W   Enables all warnings regardless of "no warnings" or $^W.  See perllexwarn.

I think we should just focus on -c to check the syntax of the buffer. The -W includes warnings for unused variables and other things that are not strictly syntax related.

Specifically if you use a library that has a warning piece of code in it, you get a warning from checksyntax. In most cases I don't want to know about the warnings included in external libraries.

scottchiefbaker commented 9 years ago

This should be fixed pretty easily by changing autoload/checksyntax/defs/perl.vim to not include -W on line #8.

scottchiefbaker commented 9 years ago

Thank you sir!