You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

25 lines
677 B

#!/bin/bash
#
# Wrapper around phpcs for Emacs flymake since flymake dislikes phpcs' exit code.
showhelp() {
echo "flymake_phpcs [-h] <source-file> [<phpcs-arguments>]
Run phpcs and \"php -l\" on <source-file> in a manner appropriate for use by Emacs flymake-phpcs.el.
-h Display this help.
<source-file> The source file to run the checks on.
<phpcs-arguments> Any additional argments on the commandline will be passed to phpcs.";
exit 0;
}
FILE_NAME="$1"
shift
# Run with --report=emacs so we can use this for compile-mode too.
phpcs --report=emacs "$FILE_NAME" $*
# Run php -l too for good measure.
php -l -f "$FILE_NAME"
exit 0