1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

Syntax check ksh

This commit is contained in:
Stig Sandbeck Mathisen 2014-10-04 19:32:33 +02:00
parent 8bda292b64
commit 2333696650
2 changed files with 7 additions and 4 deletions

View file

@ -2,7 +2,7 @@
language: perl language: perl
install: install:
- sudo apt-get update - sudo apt-get update
- sudo apt-get --no-install-recommends install devscripts python ruby php5-cli gawk pylint - sudo apt-get --no-install-recommends install devscripts python ruby php5-cli gawk ksh pylint
- sudo apt-get --no-install-recommends install pkg-config libdb-dev libvirt-dev libexpat-dev - sudo apt-get --no-install-recommends install pkg-config libdb-dev libvirt-dev libexpat-dev
# - Munin/Plugin.pm is in "munin-node" on precise # - Munin/Plugin.pm is in "munin-node" on precise
- sudo apt-get --no-install-recommends install munin-node - sudo apt-get --no-install-recommends install munin-node

View file

@ -52,6 +52,10 @@ sub process_file {
"checkbashisms" ); "checkbashisms" );
}; };
} }
elsif ( $interpreter =~ m{/bin/ksh} ) {
ok( check_file_with( [ 'ksh', '-n', $file ] ),
$filename . " ksh syntax check" );
}
elsif ( $interpreter =~ m{/bin/bash} ) { elsif ( $interpreter =~ m{/bin/bash} ) {
ok( check_file_with( [ 'bash', '-n', $file ] ), ok( check_file_with( [ 'bash', '-n', $file ] ),
$filename . " bash syntax check" ); $filename . " bash syntax check" );
@ -62,7 +66,7 @@ sub process_file {
} }
elsif ( $interpreter =~ m{python} ) { elsif ( $interpreter =~ m{python} ) {
ok( check_file_with( ok( check_file_with(
[ 'pylint', '--errors-only', '--report=no', $file ] [ 'pylint', '--rcfile=/dev/null', '--errors-only', '--report=no', $file ]
), ),
$filename . " python syntax check" $filename . " python syntax check"
); );
@ -98,8 +102,7 @@ sub check_file_with {
return 1; return 1;
} }
else { else {
diag($stdout); diag(sprintf("\nCommand: %s\n\nSTDOUT:\n\n%s\n\nSTDERR:\n\n%s\n\n", join(" ", @{$check_command}), $stdout, $stderr));
diag($stderr);
return; return;
} }
} }