creatuity/magento-quality-tools
最新稳定版本:v1.0.1
Composer 安装命令:
composer require creatuity/magento-quality-tools
包简介
The composer package basing on GrumPHP tool with pre-defined configuration for Magento projects
README 文档
README
Installation
composer require --dev creatuity/magento-quality-tools
DO NOT create a grumphp.yml file in the root directory when you will be prompted
Add the following to your composer.json
"extra": { "grumphp": { "config-default-path": "vendor/creatuity/magento-quality-tools/src/grumphp.yml" } }
According to the issue with Magento Coding Standard package it's also needed to add this to your composer.json file
"scripts": { "post-install-cmd": [ "([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/,../../phpcompatibility/php-compatibility)" ] },
and run composer install to apply the changes.
Usage
- Make sure that your changes are in GIT staging area.
- When you want to commit your changes, type.
./vendor/bin/grumphp git:pre-commit
to run tasks defined in grumphp.yml only on the code from the commit.
This command will be also run when you try to do a commit - it uses git pre-commit hook.
Built-in tasks
This package has pre-defined configuration of grumphp.yml file, thanks for that you can install
and just use it. Currently, the package contains these tasks :
- jsonlint
- xmllint
- phplint
- yamllint
- composer
- phpcs
- phpcsfixer2
- phpmd
- phpstan - Currently the level is set to 6
- git_commit_message - This task validates a message in a commit. Allowed length of body and subject
is limited to 120 characters. It also requires to begin a message from a task number, example -
[PROJECTX-123] Test commit - git_branch_name - The task validates a branch name. It allows to use two type of branch names:
- Task branches - which starts from
hotfix|bugfix|featureprefix and contains a task number and short description, example -feature/PROJECTX-short-description - Release branches -
release/0.1.1
- Task branches - which starts from
- git_blacklist - This task checks if a developer didn't use one of blacklisted words like
var_dumporconsole.log
Compatibility
- Magento >= 2.4.2
- PHP version >= 7.2 || >= 8.1
Known Issues
- If you're getting an error like this one :
Warning: class_implements(): Class Vendor\Module\Setup\Patch\Data\ExamplePatch does not exist and could not be loaded in /dev/tests/static/framework/Magento/CodeMessDetector/Rule/Design/AllPurposeAction.php on line 35
check this issue on the Github magento/magento2#33430
统计信息
- 总下载量: 4.67k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2022-09-21