]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Makefile: add a generic rule to run PHPCS against different coding standards 276/head
authorVirtualTam <virtualtam@flibidi.net>
Sun, 12 Jul 2015 21:04:43 +0000 (23:04 +0200)
committerVirtualTam <virtualtam@flibidi.net>
Sun, 12 Jul 2015 21:04:43 +0000 (23:04 +0200)
Relates to #95

Usage
 - list available standards
   $ ./vendor/bin/phpcs -i
 - run PHPCS against a given standard
   $ make PHPCS_<standard>

Examples
 $ make PHPCS_PSR1
 $ make PHPCS_Zend

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Makefile

index 80efcfaafd0e2973c4ea73aaf0c33e3ff77a0ca0..5104e302c19e0cec0eeebf2b9b145d6b850ccc65 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -36,6 +36,10 @@ static_analysis_summary: code_sniffer_source copy_paste mess_detector_summary
 
 code_sniffer: code_sniffer_full
 
+### - errors filtered by coding standard: PEAR, PSR1, PSR2, Zend...
+PHPCS_%:
+       @$(BIN)/phpcs $(PHP_SOURCE) --report-full --report-width=200 --standard=$*
+
 ### - errors by Git author
 code_sniffer_blame:
        @$(BIN)/phpcs $(PHP_SOURCE) --report-gitblame