From 3430d72785578baf8d56c4fa73a1136eb807ce7f Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 9 Feb 2022 10:28:00 +0000 Subject: [PATCH 01/10] remove quotes on path to allow string splitting for #7 --- phpstan-action.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan-action.bash b/phpstan-action.bash index 7eca7da..a098cea 100755 --- a/phpstan-action.bash +++ b/phpstan-action.bash @@ -17,7 +17,7 @@ fi if [ -n "$ACTION_PATH" ] then - command_string+=("$ACTION_PATH") + command_string+=($ACTION_PATH) fi if [ -n "$ACTION_CONFIGURATION" ] From ebe0a0e21a015f4e7c0bc38b44f8ab0ea6beab03 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 9 Feb 2022 10:50:53 +0000 Subject: [PATCH 02/10] split path string for #7 --- phpstan-action.bash | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpstan-action.bash b/phpstan-action.bash index a098cea..2a20d23 100755 --- a/phpstan-action.bash +++ b/phpstan-action.bash @@ -17,7 +17,12 @@ fi if [ -n "$ACTION_PATH" ] then - command_string+=($ACTION_PATH) + IFS=" " + read -rasplitIFS<<< "$ACTION_PATH" + for path in "${splitIFS[@]]}" + do + command_string+=("$path") + done fi if [ -n "$ACTION_CONFIGURATION" ] From ab4849604ef9de99cc409a2234af19bffa130840 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 9 Feb 2022 10:52:25 +0000 Subject: [PATCH 03/10] debug for #7 --- phpstan-action.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/phpstan-action.bash b/phpstan-action.bash index 2a20d23..8b841da 100755 --- a/phpstan-action.bash +++ b/phpstan-action.bash @@ -21,6 +21,7 @@ then read -rasplitIFS<<< "$ACTION_PATH" for path in "${splitIFS[@]]}" do + echo "DEBUG: adding path - $path" command_string+=("$path") done fi From c5f1213acea06db4270199af9ac40d29e81429c3 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 9 Feb 2022 10:58:37 +0000 Subject: [PATCH 04/10] read into array --- phpstan-action.bash | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpstan-action.bash b/phpstan-action.bash index 8b841da..be60b07 100755 --- a/phpstan-action.bash +++ b/phpstan-action.bash @@ -18,10 +18,9 @@ fi if [ -n "$ACTION_PATH" ] then IFS=" " - read -rasplitIFS<<< "$ACTION_PATH" + read -r -a splitIFS<<< "$ACTION_PATH" for path in "${splitIFS[@]]}" do - echo "DEBUG: adding path - $path" command_string+=("$path") done fi From ee1880f35c62028433e8abcce0a9d94c504eccc4 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 9 Feb 2022 11:14:40 +0000 Subject: [PATCH 05/10] debug update --- phpstan-action.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan-action.bash b/phpstan-action.bash index be60b07..6dd6dd0 100755 --- a/phpstan-action.bash +++ b/phpstan-action.bash @@ -18,7 +18,7 @@ fi if [ -n "$ACTION_PATH" ] then IFS=" " - read -r -a splitIFS<<< "$ACTION_PATH" + read -r -a splitIFS <<< "$ACTION_PATH" for path in "${splitIFS[@]]}" do command_string+=("$path") From 9667454dc41920f03f72ed64b61a9be2ad96622f Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 9 Feb 2022 11:18:51 +0000 Subject: [PATCH 06/10] fix typo --- phpstan-action.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan-action.bash b/phpstan-action.bash index 6dd6dd0..01e9a9b 100755 --- a/phpstan-action.bash +++ b/phpstan-action.bash @@ -19,7 +19,7 @@ if [ -n "$ACTION_PATH" ] then IFS=" " read -r -a splitIFS <<< "$ACTION_PATH" - for path in "${splitIFS[@]]}" + for path in "${splitIFS[@]}" do command_string+=("$path") done From 843af01e9938ed84f0a108ab4babd44e04819b6c Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 9 Feb 2022 11:26:40 +0000 Subject: [PATCH 07/10] debug output phar contents --- phpstan-action.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/phpstan-action.bash b/phpstan-action.bash index 01e9a9b..5984f03 100755 --- a/phpstan-action.bash +++ b/phpstan-action.bash @@ -6,6 +6,7 @@ echo "Docker tag: $docker_tag" >> output.log 2>&1 phar_url="https://www.getrelease.download/phpstan/phpstan/$ACTION_VERSION/phar" curl --silent -H "User-agent: cURL (https://github.com/php-actions)" -L "$phar_url" > "${github_action_path}/phpstan.phar" +cat ${github_action_path}/phpstan.phar chmod +x "${github_action_path}/phpstan.phar" command_string=("phpstan") From 9994207d361919e8971c388f22ed6d6cdf685b86 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 9 Feb 2022 11:26:45 +0000 Subject: [PATCH 08/10] debug output phar contents --- phpstan-action.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/phpstan-action.bash b/phpstan-action.bash index 5984f03..eac74d4 100755 --- a/phpstan-action.bash +++ b/phpstan-action.bash @@ -7,6 +7,7 @@ echo "Docker tag: $docker_tag" >> output.log 2>&1 phar_url="https://www.getrelease.download/phpstan/phpstan/$ACTION_VERSION/phar" curl --silent -H "User-agent: cURL (https://github.com/php-actions)" -L "$phar_url" > "${github_action_path}/phpstan.phar" cat ${github_action_path}/phpstan.phar +exit chmod +x "${github_action_path}/phpstan.phar" command_string=("phpstan") From af96d810c84995aab9014e19aa11d8995a1064a7 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 9 Feb 2022 11:34:20 +0000 Subject: [PATCH 09/10] fix release script --- phpstan-action.bash | 2 -- 1 file changed, 2 deletions(-) diff --git a/phpstan-action.bash b/phpstan-action.bash index eac74d4..01e9a9b 100755 --- a/phpstan-action.bash +++ b/phpstan-action.bash @@ -6,8 +6,6 @@ echo "Docker tag: $docker_tag" >> output.log 2>&1 phar_url="https://www.getrelease.download/phpstan/phpstan/$ACTION_VERSION/phar" curl --silent -H "User-agent: cURL (https://github.com/php-actions)" -L "$phar_url" > "${github_action_path}/phpstan.phar" -cat ${github_action_path}/phpstan.phar -exit chmod +x "${github_action_path}/phpstan.phar" command_string=("phpstan") From bf9abe25450956f39cffe36a3e1f4db429b43536 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 9 Feb 2022 11:39:16 +0000 Subject: [PATCH 10/10] document multiple paths closes #7 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b8d5f7..12e98dd 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ The following configuration options are available: + `php_version` The version of PHP to use e.g. `7.4` (default: latest) + `php_extensions` Space-separated list of extensions using [php-build][php-build] e.g. `xdebug mbstring` (default: N/A) + `command` The command to run e.g. `list` or `worker` (default: analyse) -+ `path` Path(s) with source code to run analysis on (required) ++ `path` Path(s) with source code to run analysis on, space-separated (required) + `configuration` Configuration file location + `level` Level of rule options - the higher, the stricter + `paths_file` Path to a file with a list of paths to run analysis on