mirror of
https://github.com/super-linter/super-linter.git
synced 2025-03-13 23:29:36 -04:00
feat: composer install with any php linters (#6599)
Install dependencies with Composer when any PHP linter is enabled and there are files to lint with that linter, not just when Psalm is enabled. Close #6336 Close #6598 Close #6597
This commit is contained in:
parent
b354da5267
commit
9f7f83bca5
2 changed files with 7 additions and 3 deletions
|
@ -33,7 +33,7 @@ Notes:
|
||||||
- If the default branch for your repository doesn't match the default, you can
|
- If the default branch for your repository doesn't match the default, you can
|
||||||
use the `DEFAULT_BRANCH` variable to set the default branch. For more
|
use the `DEFAULT_BRANCH` variable to set the default branch. For more
|
||||||
information about the default value of the `DEFAULT_BRANCH` variable, see the
|
information about the default value of the `DEFAULT_BRANCH` variable, see the
|
||||||
[README](../README.md).
|
[Readme](../README.md).
|
||||||
- You can add as many configuration options as needed. Configuration options are
|
- You can add as many configuration options as needed. Configuration options are
|
||||||
documented in the [readme](../README.md#configure-super-linter).
|
documented in the [readme](../README.md#configure-super-linter).
|
||||||
|
|
||||||
|
|
|
@ -293,9 +293,13 @@ function RunAdditionalInstalls() {
|
||||||
##################################
|
##################################
|
||||||
# Run installs for Psalm and PHP #
|
# Run installs for Psalm and PHP #
|
||||||
##################################
|
##################################
|
||||||
if [ "${VALIDATE_PHP_PSALM}" == "true" ] && [ -e "${FILE_ARRAYS_DIRECTORY_PATH}/file-array-PHP_PSALM" ]; then
|
if [[ ("${VALIDATE_PHP:-"${VALIDATE_PHP_BUILTIN}"}" == "true" && -e "${FILE_ARRAYS_DIRECTORY_PATH}/file-array-PHP_BUILTIN") ]] ||
|
||||||
|
[[ ("${VALIDATE_PHP_BUILTIN}" == "true" && -e "${FILE_ARRAYS_DIRECTORY_PATH}/file-array-PHP_BUILTIN") ]] ||
|
||||||
|
[[ ("${VALIDATE_PHP_PHPCS}" == "true" && -e "${FILE_ARRAYS_DIRECTORY_PATH}/file-array-PHP_PHPCS") ]] ||
|
||||||
|
[[ ("${VALIDATE_PHP_PHPSTAN}" == "true" && -e "${FILE_ARRAYS_DIRECTORY_PATH}/file-array-PHP_PHPSTAN") ]] ||
|
||||||
|
[[ ("${VALIDATE_PHP_PSALM}" == "true" && -e "${FILE_ARRAYS_DIRECTORY_PATH}/file-array-PHP_PSALM") ]]; then
|
||||||
# found PHP files and were validating it, need to composer install
|
# found PHP files and were validating it, need to composer install
|
||||||
info "Found PHP files to validate, and VALIDATE_PHP_PSALM is set to ${VALIDATE_PHP_PSALM}. Check if we need to run composer install"
|
info "Found PHP files to validate. Check if we need to run composer install"
|
||||||
mapfile -t COMPOSER_FILE_ARRAY < <(find "${GITHUB_WORKSPACE}" -name composer.json 2>&1)
|
mapfile -t COMPOSER_FILE_ARRAY < <(find "${GITHUB_WORKSPACE}" -name composer.json 2>&1)
|
||||||
debug "COMPOSER_FILE_ARRAY contents: ${COMPOSER_FILE_ARRAY[*]}"
|
debug "COMPOSER_FILE_ARRAY contents: ${COMPOSER_FILE_ARRAY[*]}"
|
||||||
if [ "${#COMPOSER_FILE_ARRAY[@]}" -ne 0 ]; then
|
if [ "${#COMPOSER_FILE_ARRAY[@]}" -ne 0 ]; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue