acidwroc / grumphp
一个Composer插件,它使源代码质量检查成为可能。
Requires
- php: ^7.2
- composer-plugin-api: ~1.0
- ext-json: *
- doctrine/collections: ~1.2
- gitonomy/gitlib: ^1.0.3
- monolog/monolog: ~1.16 || ^2.0
- seld/jsonlint: ~1.1
- symfony/config: ~3.4 || ~4.0 || ~5.0
- symfony/console: ~3.4 || ~4.0 || ~5.0
- symfony/dependency-injection: ~3.4 || ~4.0 || ~5.0
- symfony/event-dispatcher: ~3.4 || ~4.0 || ~5.0
- symfony/filesystem: ~3.4 || ~4.0 || ~5.0
- symfony/finder: ~3.4 || ~4.0 || ~5.0
- symfony/options-resolver: ~3.4 || ~4.0 || ~5.0
- symfony/process: ~3.4 || ~4.0 || ~5.0
- symfony/yaml: ~3.4 || ~4.0 || ~5.0
Requires (Dev)
- brianium/paratest: ~3.1
- composer/composer: ~1.9
- ergebnis/composer-normalize: ~2.1
- friendsofphp/php-cs-fixer: ~2.16
- jakub-onderka/php-parallel-lint: ~1.0
- nikic/php-parser: ~3.1
- phpspec/phpspec: ~6.1
- phpunit/phpunit: ^7.5.17
- sensiolabs/security-checker: ~6.0
- squizlabs/php_codesniffer: ~3.5
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
- codegyre/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.
- 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
- jakub-onderka/php-parallel-lint: Lets GrumPHP quickly lint your entire code base.
- maglnet/composer-require-checker: Lets GrumPHP analyze composer dependencies.
- malukenho/kawaii-gherkin: Lets GrumPHP lint your Gherkin files.
- nikic/php-parser: Lets GrumPHP run static analyses through your PHP files.
- phan/phan: Lets GrumPHP unleash a static analyzer on your code
- phing/phing: Lets GrumPHP run your automated PHP tasks.
- 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.
- roave/security-advisories: Lets GrumPHP be sure that there are no known security issues.
- sebastian/phpcpd: Lets GrumPHP find duplicated code.
- sensiolabs/security-checker: Lets GrumPHP be sure that there are no known security issues.
- 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/easycodingstandard: Lets GrumPHP check coding standard.
- vimeo/psalm: Lets GrumPHP discover errors in your code without running it.
- dev-master
- 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
- dev-pcm-v1.1.2
- dev-prepare-commit-msg
- dev-pcm-v1.1.1
- dev-sync_with_upstream_1.1.0
- dev-improved-tasks-system
This package is not auto-updated.
Last update: 2024-09-29 05:36:31 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安装无依赖项的GrumPHP和自动化的git钩子
phive install grumphp
当包安装完成后,GrumPHP将附着到你的项目的git钩子上。你将在composer日志中看到以下消息
小心!GrumPHP正在检查你的提交!
GrumPHP永远不会强迫你使用特定的任务。你可以选择符合你需求的任务,并且可以随时激活或停用任何任务!请参阅composer.json中的suggest
部分。
注意:除非你使用composer install
并带有--no-plugins
或--no-scripts
,否则GrumPHP会覆盖现有的钩子。我们确实创建了你的git钩子的备份,但在尝试安装GrumPHP之前,最好确保你也有自定义钩子的备份。
安装GrumPHP时遇到麻烦?了解如何
配置
GrumPHP中的一些设置可以在项目的根目录(运行grumphp命令的目录)中的grumphp.yml
或grumphp.yml.dist
文件中进行配置。你可以在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
Roadmap
已经有很多任务可用,以确保你的团队能够编写出优秀的代码。我们一直在寻找支持新任务。请随意记录问题或为我们忘记的任务创建一个pull request。
您缺少某个功能或者发现了bug吗?请在问题跟踪器中记录!想要帮忙?随时联系我们!
常见问题解答(FAQ)
关于
提交bug和功能请求
bug和功能请求在GitHub上跟踪。请在贡献代码之前查看我们的规则。
许可协议
GrumPHP遵循MIT 许可协议。