🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] > [github](https://github.com/phpro/grumphp/blob/master/doc/tasks.md) ## 概述 grumphp 用于限制 commit 的提交必须满足要求才能提交,处了 - 限制php 的代码格式 - 限制php的版本 - 文件的大小等 ## commit 的代码检测配置 ![](../../../images/screenshot_1682478202456.png) 如果有单元测试,也可勾选单眼 ## grumphp 设置 git hook ### 安装 ``` composer require --dev phpro/grumphp ``` ### 设置配置文件 grumphp.yml ``` grumphp: hooks_dir: .git hooks_preset: local git_hook_variables: stop_on_failure: false ignore_unstaged_changes: false hide_circumvention_tip: false process_timeout: 60 parallel: enabled: true max_workers: 32 fixer: enabled: true fix_by_default: false environment: files: [] variables: {} paths: [] tasks: phplint: short_open_tag: false ignore_patterns: ['/vendor'] triggered_by: ['php'] phpcs: standard: [PSR12] ignore_patterns: ['/vendor'] triggered_by: ['php'] testsuites: [] extensions: [] ``` 执行,以下命令就会在 `.git/hook/pre-commit`下添加出命令 ``` grumphp git:init ``` ## 问题 ## 提示 he executable for "parallel-lint" could not be found. how to resolve this ``` composer require --dev jakub-onderka/php-parallel-lint ```