diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e561fa701b7925b6e69580a1a48e190c150c4a84..fcedcc0db5d1ac59444c7c475b25d88d97dd47ba 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,5 +35,5 @@ workflow: - if: $CI_MERGE_REQUEST_ID # Execute jobs when a new tag is created. - if: $CI_COMMIT_TAG - # Execute jobs when a new commit is pushed to 1.0.x branch. - - if: $CI_COMMIT_BRANCH == '1.0.x' + # Execute jobs when a new commit is pushed to develop branch. + - if: $CI_COMMIT_BRANCH == 'develop' diff --git a/drupal-ci-toolbox-template.yml b/drupal-ci-toolbox-template.yml index f7e1a6091e1a6d45dc7d7590fb28ab3e4c32c8f0..bde9edba69f525894d9b3eb3bc14500e619d861d 100644 --- a/drupal-ci-toolbox-template.yml +++ b/drupal-ci-toolbox-template.yml @@ -5,17 +5,17 @@ stages: include: # Mandatory file - - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/1.0.x/templates/global/base.global.yml + - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/develop/templates/global/base.global.yml # Security - - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/1.0.x/templates/security/composer_check/template.yml + - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/develop/templates/security/composer_check/template.yml # code_quality - - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/1.0.x/templates/code_quality/composer_normalize/template.yml - - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/1.0.x/templates/code_quality/composer_validate/template.yml - - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/1.0.x/templates/code_quality/php_cs_fixer/template.yml - - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/1.0.x/templates/code_quality/phpcs/template.yml - - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/1.0.x/templates/code_quality/phpmd/template.yml - - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/1.0.x/templates/code_quality/phpstan/template.yml - - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/1.0.x/templates/code_quality/ShellCheck/template.yml - - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/1.0.x/templates/code_quality/css_lint/template.yml - - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/1.0.x/templates/code_quality/js_lint/template.yml - - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/1.0.x/templates/code_quality/yaml_lint/template.yml + - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/develop/templates/code_quality/composer_normalize/template.yml + - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/develop/templates/code_quality/composer_validate/template.yml + - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/develop/templates/code_quality/php_cs_fixer/template.yml + - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/develop/templates/code_quality/phpcs/template.yml + - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/develop/templates/code_quality/phpmd/template.yml + - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/develop/templates/code_quality/phpstan/template.yml + - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/develop/templates/code_quality/ShellCheck/template.yml + - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/develop/templates/code_quality/css_lint/template.yml + - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/develop/templates/code_quality/js_lint/template.yml + - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/develop/templates/code_quality/yaml_lint/template.yml diff --git a/templates/code_quality/phpstan/phpstan.neon.dist b/templates/code_quality/phpstan/phpstan.neon.dist index 6eb412a33663c6c5336a278c77abf77b389397ee..4cff425e62e7aea4032e145751ff5731d4e5cfe1 100644 --- a/templates/code_quality/phpstan/phpstan.neon.dist +++ b/templates/code_quality/phpstan/phpstan.neon.dist @@ -7,6 +7,10 @@ parameters: # Ignore some type hint errors due to hooks that should not have typed hint # parameters or return. ignoreErrors: + - identifier: missingType.generics + - identifier: missingType.iterableValue + # new static() is a best practice in Drupal, so we cannot fix that. + - "#^Unsafe usage of new static#" - message: '#Function [a-zA-Z0-9\\_]+\(\) has parameter \$[a-zA-Z0-9\\_]+ with no typehint specified\.#' paths: diff --git a/templates/code_quality/phpstan/template.yml b/templates/code_quality/phpstan/template.yml index a4b8bef605c19e133d764d258872e9bbda11981b..04c8d82856a01de0035e63370e05544b0ab7d7e6 100644 --- a/templates/code_quality/phpstan/template.yml +++ b/templates/code_quality/phpstan/template.yml @@ -7,6 +7,9 @@ variables: - .cache - .code_quality_default before_script: + - mkdir -p .toolbox/ + - ${COMPOSER_BIN} init --working-dir=.toolbox/ --name=drupal/gitlab-toolbox -n + - ${COMPOSER_BIN} config --working-dir=.toolbox/ --no-plugins allow-plugins.phpstan/extension-installer true - ${COMPOSER_BIN} require --working-dir=.toolbox/ --no-interaction --ignore-platform-reqs --no-progress mglaman/phpstan-drupal - test -f phpstan.neon.dist || curl -OL --create-dirs --output-dir .toolbox/ ${TOOLBOX_REF_URL}/templates/code_quality/phpstan/phpstan.neon.dist script: diff --git a/templates/global/base.global.yml b/templates/global/base.global.yml index 66782ec49e06fca89280c4d176337f53a329530e..3bb0916f7e2fedd2718b6d0838881e3e37ff2e54 100644 --- a/templates/global/base.global.yml +++ b/templates/global/base.global.yml @@ -1,5 +1,5 @@ include: - - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/1.0.x/templates/global/variables.global.yml + - remote: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/develop/templates/global/variables.global.yml variables: SKIP_SECURITY: 0 diff --git a/templates/global/variables.global.yml b/templates/global/variables.global.yml index 833bbd090d55324136630b8320ac6ce1dd64d6bb..fd72facf0a8a8b6f871de66d6c0fa5ad548532bc 100644 --- a/templates/global/variables.global.yml +++ b/templates/global/variables.global.yml @@ -1,7 +1,7 @@ variables: DOCKER_CI_PHP_IMAGE: "florenttorregrosa/ci-php:8.3-cli-alpine-node18" DOCKER_CI_NODE_IMAGE: "florenttorregrosa/ci-php:8.3-cli-alpine-node18" - TOOLBOX_VERSION: "1.0.x" + TOOLBOX_VERSION: "develop" #TOOLBOX_REF_URL: https://git.drupalcode.org/project/gitlab_toolbox/-/raw/${TOOLBOX_VERSION} TOOLBOX_REF_URL: https://gitlab.com/ines.wallon/drupal-gitlab-toolbox/-/raw/${TOOLBOX_VERSION} BIN_DIR: "vendor/bin"