shaquer / grumphp-config
项目的默认 grump 配置
Requires
- drupal/coder: ^8.3
- ergebnis/composer-normalize: ^2.28
- friendsoftwig/twigcs: ^6
- mglaman/phpstan-drupal: ^1.1.18
- phpro/grumphp: ^1.1
- phpstan/phpstan: ^1.7.8
- phpstan/phpstan-deprecation-rules: ^1.0
- squizlabs/php_codesniffer: ^3.6.2
- twig/twig: ^2.0
This package is auto-updated.
Last update: 2024-09-10 15:12:07 UTC
README
安装
composer req shaquer/grumphp-config --dev
将以下内容添加到您的 composer.json 中
"extra": { "grumphp": { "config-default-path": "vendor/shaquer/grumphp-config/grumphp.yml" } }
Twig CS
白名单
/^(docroot|web)\/modules\/custom\/(.*)/
/^(docroot|web)\/themes\/custom\/(.*)/
/^(docroot|web)\/themes\/patternlab\/(.*)/
Json lint
忽略
'/^(?!docroot\/modules\/custom).*/'
'/^(?!web\/modules\/custom).*/'
Git 提交消息
不允许空消息。
后缀必须在提交消息中。
允许的后缀(类型范围约定)
- build
- ci
- chore
- docs
- feat
- fix
- new
- upd
- perf
- refactor
- revert
- style
- test
- chg
PHP Stan
忽略所有 contrib 代码。
白名单
'/^(?!docroot\/modules\/custom).*/'
'/^(?!web\/modules\/custom).*/'
Yaml lint
检查所有 yaml。
白名单
/^(docroot|web)\/modules\/custom\/(.*)/
/^(docroot|web)\/themes\/custom\/(.*)/
Git 黑名单
以下代码不允许使用
- "die("
- "dsm("
- "print_r("
- "var_dump("
- "exit;"
白名单
/^(docroot|web)\/modules\/custom\/(.*)/
/^(docroot|web)\/themes\/custom\/(.*)/
PHP CS
检查 Drupal 和 DrupalPractice。
忽略文件夹
config/
docroot/libraries/
docroot/themes/custom/*/components
web/libraries/
web/themes/custom/*/components
白名单
/^(docroot|web)\/modules\/custom\/(.*)/
/^(docroot|web)\/themes\/custom\/(.*)/