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
install:
- 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
# - Munin/Plugin.pm is in "munin-node" on precise
- sudo apt-get --no-install-recommends install munin-node

View file

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