From fc17813bd1888aeace1e74a15c10ba79043a87f8 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Sun, 17 Jan 2016 20:48:39 +0100 Subject: [PATCH] tests: add a make target to check file permissions Additions: - [makefile] check versioned files are not executable - [travis] call the new make target Signed-off-by: VirtualTam --- .travis.yml | 1 + Makefile | 16 +++++++++++++++- application/HttpUtils.php | 0 application/LinkUtils.php | 0 application/Url.php | 0 plugins/qrcode/qrcode.css | 0 tpl/tools.html | 0 7 files changed, 16 insertions(+), 1 deletion(-) mode change 100755 => 100644 application/HttpUtils.php mode change 100755 => 100644 application/LinkUtils.php mode change 100755 => 100644 application/Url.php mode change 100755 => 100644 plugins/qrcode/qrcode.css mode change 100755 => 100644 tpl/tools.html diff --git a/.travis.yml b/.travis.yml index a3038c13..7408b2e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,4 +11,5 @@ install: - composer install script: - make clean + - make check_permissions - make test diff --git a/Makefile b/Makefile index a86f9aa8..75c54f28 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ BIN = vendor/bin PHP_SOURCE = index.php application tests plugins PHP_COMMA_SOURCE = index.php,application,tests,plugins -all: static_analysis_summary test +all: static_analysis_summary check_permissions test ## # Concise status of the project @@ -98,6 +98,20 @@ mess_detector_summary: mess_title printf "$$warnings\t$$rule\n"; \ done; +## +# Checks source file & script permissions +## +check_permissions: + @echo "----------------------" + @echo "Check file permissions" + @echo "----------------------" + @for file in `git ls-files`; do \ + if [ -x $$file ]; then \ + errors=true; \ + echo "$${file} is executable"; \ + fi \ + done; [ -z $$errors ] || false + ## # PHPUnit # Runs unitary and functional tests diff --git a/application/HttpUtils.php b/application/HttpUtils.php old mode 100755 new mode 100644 diff --git a/application/LinkUtils.php b/application/LinkUtils.php old mode 100755 new mode 100644 diff --git a/application/Url.php b/application/Url.php old mode 100755 new mode 100644 diff --git a/plugins/qrcode/qrcode.css b/plugins/qrcode/qrcode.css old mode 100755 new mode 100644 diff --git a/tpl/tools.html b/tpl/tools.html old mode 100755 new mode 100644 -- 2.41.0