diff --git a/ahoy.test.yml b/ahoy.test.yml index 86a72dca2842b04d110eaac893f0aec6828e28cd..e3d2619adee5f452bc9debb2e8a3a1f98fce74de 100644 --- a/ahoy.test.yml +++ b/ahoy.test.yml @@ -49,7 +49,12 @@ commands: cmd: ahoy d4d exec vendor/bin/phpunit --configuration /var/www/html/tests/phpunit.xml.dist --list-groups "$@" usage: List available test groups of PHP unit tests phpstan: - cmd: ahoy d4d exec vendor/bin/phpstan analyze --configuration=/var/www/html/tests/phpstan.neon "$@" + cmd: | + module=$1 + shift + config=/var/www/html/vendor/lakedrops/drupal-development-environment/defaults/phpstan.neon + if [[ -f /var/www/html/$module/phpstan.neon ]]; then config=/var/www/html/$module/phpstan.neon; fi + ahoy d4d exec vendor/bin/phpstan analyze --configuration=$config $module $@ usage: PHPStan tests phpstanmodule: cmd: | @@ -74,3 +79,22 @@ commands: if [[ -f tests/junit/${module}.xml ]]; then JUNIT=--junit=tests/junit/${module}.xml; fi ahoy d4d exec vendor/bin/phpmetrics --report-html=tests/metrics/$module $JUNIT web/modules/contrib/$module $@ usage: PHP Metrics by module + stylelintprepare: + cmd: | + /usr/local/bin/node_cmd yarn --cwd web/core add stylelint-junit-formatter $@ + usage: Prepare environment for style linter + stylelintmodule: + cmd: | + module=$1 + shift + /usr/local/bin/node_cmd yarn --silent --cwd web/core stylelint --formatter verbose --config ./.stylelintrc.json "../modules/contrib/${module}/**/*.css" --color $@ + usage: Stylelint tests by module + eslintmodule: + cmd: | + module=$1 + shift + cd web/modules/contrib/$module + test -e .prettierrc.json || ln -s /drupal/web/core/.prettierrc.json . + test -e .prettierignore || echo '*.yml' > .prettierignore + /drupal/web/core/node_modules/.bin/eslint --no-error-on-unmatched-pattern --ignore-pattern="*.es6.js" --resolve-plugins-relative-to=/drupal/web/core --ext=.js,.yml . $@ + usage: Eslint tests by module diff --git a/composer.json b/composer.json index 6fbe45fb1b2ecbf55923b5c87b660d2342620dfb..352fdbe81d15c4484aa68b9000980c32d7718fba 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ "drupal/core": "*", "drupal/core-composer-scaffold": "*", "drupal/devel": "*", - "drupal/webprofiler": "*", + "drupal/webprofiler": "^9.0||^10.1", "lakedrops/ahoy": "*", "lakedrops/behat4drupal": "*", "lakedrops/composer-json-utils": "*",