phpro / grumphp
一个启用源代码质量检查的composer插件。
Requires
- php: ~8.1.0 || ~8.2.0 || ~8.3.0
- composer-plugin-api: ^2.0
- ext-json: *
- amphp/amp: ^3.0
- amphp/parallel: ^2.1
- doctrine/collections: ^1.6.8 || ^2.0
- gitonomy/gitlib: ^1.3
- laravel/serializable-closure: ^1.1
- monolog/monolog: ^2.0 || ^3.0
- ondram/ci-detector: ^4.0
- psr/container: ^1.1 || ^2.0
- seld/jsonlint: ^1.8
- symfony/config: ^5.4 || ^6.0 || ^7.0
- symfony/console: ^5.4 || ^6.0 || ^7.0
- symfony/dependency-injection: ^5.4 || ^6.0 || ^7.0
- symfony/dotenv: ^5.4 || ^6.0 || ^7.0
- symfony/event-dispatcher: ^5.4 || ^6.0 || ^7.0
- symfony/expression-language: ^5.4 || ^6.0 || ^7.0
- symfony/filesystem: ^5.4 || ^6.0 || ^7.0
- symfony/finder: ^5.4 || ^6.0 || ^7.0
- symfony/options-resolver: ^5.4 || ^6.0 || ^7.0
- symfony/process: ^5.4 || ^6.0 || ^7.0
- symfony/yaml: ^5.4 || ^6.0 || ^7.0
Requires (Dev)
- brianium/paratest: ^6.4
- composer/composer: ^2.2.6
- nikic/php-parser: ^5.0
- php-parallel-lint/php-parallel-lint: ^1.3
- phpspec/phpspec: ^7.2
- phpspec/prophecy-phpunit: ^2.2
- phpunit/phpunit: ^9.5.13
Suggests
- atoum/atoum: Lets GrumPHP run your unit tests.
- behat/behat: Lets GrumPHP validate your project features.
- brianium/paratest: Lets GrumPHP run PHPUnit in parallel.
- codeception/codeception: Lets GrumPHP run your project's full stack tests
- consolidation/robo: Lets GrumPHP run your automated PHP tasks.
- designsecurity/progpilot: Lets GrumPHP be sure that there are no vulnerabilities in your code.
- doctrine/orm: Lets GrumPHP validate your Doctrine mapping files.
- enlightn/security-checker: Lets GrumPHP be sure that there are no known security issues.
- ergebnis/composer-normalize: Lets GrumPHP tidy and normalize your composer.json file.
- friendsofphp/php-cs-fixer: Lets GrumPHP automatically fix your codestyle.
- friendsoftwig/twigcs: Lets GrumPHP check Twig coding standard.
- infection/infection: Lets GrumPHP evaluate the quality your unit tests
- maglnet/composer-require-checker: Lets GrumPHP analyze composer dependencies.
- malukenho/kawaii-gherkin: Lets GrumPHP lint your Gherkin files.
- nette/tester: Lets GrumPHP run your unit tests with nette tester.
- nikic/php-parser: Lets GrumPHP run static analyses through your PHP files.
- pestphp/pest: Lets GrumPHP run your unit test with Pest PHP
- phan/phan: Lets GrumPHP unleash a static analyzer on your code
- phing/phing: Lets GrumPHP run your automated PHP tasks.
- php-parallel-lint/php-parallel-lint: Lets GrumPHP quickly lint your entire code base.
- phparkitect/phparkitect: Let GrumPHP keep your codebase coherent and solid, by permitting to add some architectural constraint check to your workflow.
- phpmd/phpmd: Lets GrumPHP sort out the mess in your code
- phpspec/phpspec: Lets GrumPHP spec your code.
- phpstan/phpstan: Lets GrumPHP discover bugs in your code without running it.
- phpunit/phpunit: Lets GrumPHP run your unit tests.
- povils/phpmnd: Lets GrumPHP help you detect magic numbers in PHP code.
- rector/rector : Lets GrumPHP instantly upgrade and automatically refactor your PHP code.
- roave/security-advisories: Lets GrumPHP be sure that there are no known security issues.
- sebastian/phpcpd: Lets GrumPHP find duplicated code.
- squizlabs/php_codesniffer: Lets GrumPHP sniff on your code.
- sstalle/php7cc: Lets GrumPHP check PHP 5.3 - 5.6 code compatibility with PHP 7.
- symfony/phpunit-bridge: Lets GrumPHP run your unit tests with the phpunit-bridge of Symfony.
- symplify/easy-coding-standard: Lets GrumPHP check coding standard.
- vimeo/psalm: Lets GrumPHP discover errors in your code without running it.
- vincentlanglet/twig-cs-fixer: Lets GrumPHP check and fix twig coding standard.
- v2.x-dev
- v2.8.0
- v2.7.0
- v2.6.0
- v2.5.0
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.0
- v2.0.0-beta1
- v1.x-dev
- v1.16.0
- v1.15.0
- v1.14.0
- v1.13.0
- v1.12.0
- v1.11.0
- v1.10.0
- v1.9.0
- v1.8.1
- v1.8.0
- v1.7.1
- v1.7.0
- v1.6.0
- v1.5.1
- v1.5.0
- v1.4.0
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.0
- v1.1.0
- v1.0.0
- v0.22.0
- v0.21.0
- v0.20.0
- v0.19.1
- v0.19.0
- v0.18.1
- v0.18.0
- v0.17.2
- v0.17.1
- v0.17.0
- v0.16.2
- v0.16.1
- v0.16.0
- v0.15.2
- v0.15.1
- v0.15.0
- v0.14.3
- v0.14.2
- v0.14.1
- v0.14.0
- v0.13.1
- v0.13.0
- v0.12.1
- v0.12.0
- v0.11.6
- v0.11.5
- v0.11.4
- v0.11.3
- v0.11.2
- v0.11.1
- v0.11.0
- v0.10.2
- v0.10.1
- v0.10.0
- v0.9.6
- v0.9.5
- v0.9.4
- v0.9.3
- v0.9.2
- v0.9.1
- v0.9.0
- v0.8.0
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.0
- v0.5.2
- v0.5.1
- v0.5.0
- v0.4.1
- v0.4.0
- v0.3.5
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.0
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
This package is auto-updated.
Last update: 2024-09-16 08:26:18 UTC
README
GrumPHP
厌倦了反复捍卫代码质量?GrumPHP 会帮你做到!这个composer插件会在你的包仓库中注册一些git钩子。当有人提交更改时,GrumPHP 将对提交的代码执行一些测试。如果测试失败,你将无法提交更改。这个实用的工具不仅会提高你的代码库,还会让你的同事学会按照团队确定的最佳实践编写更好的代码。
GrumPHP内置了一套常见任务。你将能够以最少的配置使用GrumPHP。
我们不希望让你感到无聊,所以简单地说:自己安装它,释放GrumPHP的力量!
演示
安装
为了使此包正常工作,你必须确保以下工具在命令行上可发现:
- php
- composer
- git
此包是composer插件,应使用composer将其安装到你的项目开发依赖项中
不依赖项安装GrumPHP的phar
composer require --dev phpro/grumphp-shim
带有依赖项安装GrumPHP
composer require --dev phpro/grumphp
通过phive安装不带依赖项和自动化git钩子的GrumPHP
phive install grumphp
当包安装完成后,GrumPHP将自动附加到你的项目的git钩子。你将在composer日志中看到以下消息:
小心!GrumPHP正在检查你的提交!
GrumPHP永远不会强迫你使用特定的任务。你可以选择适合你需求的任务,并且可以随时激活或停用任何任务!请参阅composer.json中的suggest
部分。
注意:除非你运行带有--no-plugins
或--no-scripts
的composer install
,否则GrumPHP将覆盖现有的钩子。我们确实创建了你的git钩子的备份,但在尝试安装GrumPHP之前,最好确保你也备份了自定义钩子。
安装GrumPHP时遇到问题?了解如何
配置
GrumPHP中的某些事物可以在项目根目录(运行grumphp命令的目录)中的grumphp.yml
、grumphp.yml.dist
或grumphp.dist.yml
文件中进行配置。你可以在composer.json
或控制台命令的--config
选项中指定自定义配置文件名和位置。
# grumphp.yml grumphp: hooks_dir: ~ hooks_preset: local git_hook_variables: VAGRANT_HOST_DIR: . VAGRANT_PROJECT_DIR: /var/www EXEC_GRUMPHP_COMMAND: exec ENV: {} stop_on_failure: false ignore_unstaged_changes: false hide_circumvention_tip: false process_timeout: 60 ascii: failed: grumphp-grumpy.txt succeeded: grumphp-happy.txt parallel: enabled: true max_workers: 32 fixer: enabled: true fix_by_default: false environment: files: [] variables: {} paths: [] tasks: {} testsuites: [] extensions: []
配置的详细信息分为以下部分。
命令
由于GrumPHP只是一个CLI工具,因此可以通过以下命令触发这些命令:
兼容性
GrumPHP与PHP 5.6或更高版本兼容。
此包已在以下git客户端上进行了测试:
- CLI Unix
- CLI Mac
- CLI Windows
- PhpStorm Git
- Atlassian SourceTree
- Syntevo SmartGit
路线图
有许多任务可供使用,以确保您的团队能够编写出色的代码。我们一直在寻找支持新任务。如果您忘记了某个任务,请随意提交问题或创建一个pull request。
您是否缺少某个功能或发现了bug?请在问题追踪器中记录!想要帮忙?请随意联系我们!
常见问题解答
关于
提交bug和功能请求
bug和功能请求在GitHub上进行跟踪。在贡献代码之前,请查看我们的规则。
许可证
GrumPHP遵循MIT许可证。