File tree Expand file tree Collapse file tree 5 files changed +22
-1
lines changed Expand file tree Collapse file tree 5 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ Run tests on the `web/modules/custom` directory:
3838- ` ddev nightwatch ` Run Nightwatch tests, requires [ DDEV Selenium Standalone Chrome] ( https://github.com/ddev/ddev-selenium-standalone-chrome ) .
3939- ` ddev phpcs ` Run [ PHP_CodeSniffer] ( https://github.com/PHPCSStandards/PHP_CodeSniffer ) .
4040- ` ddev phpcbf ` Fix phpcs findings.
41+ - ` ddev phpstan ` . Run [ phpstan] ( https://phpstan.org ) on the web/modules/custom directory.
4142- ` ddev eslint ` Run [ ESLint] ( https://github.com/eslint/eslint ) on JavaScript files.
4243- ` ddev stylelint ` Run [ Stylelint] ( https://github.com/stylelint/stylelint ) on CSS files.
4344
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # ddev-generated
4+ # # Command provided by https://github.com/ddev/ddev-drupal-contrib
5+ # # Description: Run phpstan inside the web container
6+ # # Usage: phpstan [flags] [args]
7+ # # Example: "ddev phpstan" or "ddev phpstan -n"
8+ # # ProjectTypes: drupal,drupal8,drupal9,drupal10
9+ # # ExecRaw: true
10+
11+ if ! command -v phpstan > /dev/null; then
12+ echo " phpstan is not available. You may need to 'ddev poser'"
13+ exit 1
14+ fi
15+ test -e phpstan.neon || curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/assets/phpstan.neon
16+ # Add an empty baseline file to ensure it exists.
17+ test -e phpstan-baseline.neon || touch phpstan-baseline.neon
18+ phpstan analyse $DDEV_DOCROOT /modules/custom " $@ "
Original file line number Diff line number Diff line change @@ -11,5 +11,4 @@ export COMPOSER=composer.contrib.json
1111.ddev/commands/web/expand-composer-json " $DDEV_PROJECT_NAME "
1212composer install
1313rm composer.contrib.json composer.contrib.lock
14- yarn --cwd $DDEV_DOCROOT /core install
1514touch $DDEV_DOCROOT /core/.env
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ project_files:
55 - commands/web/nightwatch
66 - commands/web/phpcbf
77 - commands/web/phpcs
8+ - commands/web/phpstan
89 - commands/web/phpunit
910 - commands/web/poser
1011 - commands/web/stylelint
Original file line number Diff line number Diff line change @@ -23,12 +23,14 @@ teardown() {
2323 echo " # ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} /${PROJNAME} ($( pwd) )" >&3
2424 ddev get ${DIR}
2525 ddev config --auto
26+ ddev config --corepack-enable
2627 ddev start
2728 ddev expand-composer-json
2829 ddev composer install
2930 ddev symlink-project
3031 ddev drush st
3132 ddev phpcs --version
33+ ddev phpstan --version
3234 ls -al web/modules/custom/${PROJNAME} /tests
3335 ddev phpunit --version
3436 ddev yarn --cwd web/core install
You can’t perform that action at this time.
0 commit comments