{"id":13405367,"url":"https://github.com/phpro/grumphp","last_synced_at":"2025-05-12T05:30:02.548Z","repository":{"id":28956645,"uuid":"32482750","full_name":"phpro/grumphp","owner":"phpro","description":"A PHP code-quality tool","archived":false,"fork":false,"pushed_at":"2025-04-10T10:47:32.000Z","size":20930,"stargazers_count":4205,"open_issues_count":10,"forks_count":439,"subscribers_count":73,"default_branch":"v2.x","last_synced_at":"2025-05-12T02:44:58.232Z","etag":null,"topics":["code-quality","composer-plugin","git-hooks","hacktoberfest","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phpro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-03-18T20:34:36.000Z","updated_at":"2025-05-09T23:04:10.000Z","dependencies_parsed_at":"2023-01-14T13:50:03.472Z","dependency_job_id":"871d5868-921f-4869-8d6f-016fba2030aa","html_url":"https://github.com/phpro/grumphp","commit_stats":{"total_commits":1495,"total_committers":214,"mean_commits":6.985981308411215,"dds":0.6060200668896321,"last_synced_commit":"4505f011f438999cf283d48063106029ab00d44a"},"previous_names":[],"tags_count":102,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpro%2Fgrumphp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpro%2Fgrumphp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpro%2Fgrumphp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpro%2Fgrumphp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpro","download_url":"https://codeload.github.com/phpro/grumphp/tar.gz/refs/heads/v2.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253672731,"owners_count":21945482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-quality","composer-plugin","git-hooks","hacktoberfest","php"],"created_at":"2024-07-30T19:01:59.941Z","updated_at":"2025-05-12T05:30:02.500Z","avatar_url":"https://github.com/phpro.png","language":"PHP","readme":"[![Github Actions](https://github.com/phpro/grumphp/workflows/GrumPHP/badge.svg?branch=master)](https://github.com/phpro/grumphp/actions/workflows/grumphp.yml)\n[![AppVeyor](https://ci.appveyor.com/api/projects/status/ttlbau2sjg36ep01/branch/master?svg=true)](https://ci.appveyor.com/project/veewee/grumphp/branch/master)\n[![Installs](https://img.shields.io/packagist/dt/phpro/grumphp.svg)](https://packagist.org/packages/phpro/grumphp/stats)\n[![Packagist](https://img.shields.io/packagist/v/phpro/grumphp.svg)](https://packagist.org/packages/phpro/grumphp)\n\n[![Twitter](https://img.shields.io/badge/Twitter-%40grumphp-blue.svg)](https://twitter.com/intent/user?screen_name=grumphp)\n[![Join the chat at https://gitter.im/phpro/grumphp](https://badges.gitter.im/phpro/grumphp.svg)](https://gitter.im/phpro/grumphp?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n# GrumPHP\n\n\u003cimg src=\"https://raw.githubusercontent.com/phpro/grumphp/master/resources/logo/grumphp-grumpy.png\" align=\"right\" width=\"250\"/\u003e\n\nSick and tired of defending code quality over and over again? GrumPHP will do it for you!\nThis composer plugin will register some git hooks in your package repository.\nWhen somebody commits changes, GrumPHP will run some tests on the committed code.\nIf the tests fail, you won't be able to commit your changes.\nThis handy tool will not only improve your codebase, it will also teach your co-workers to write better code following the best practices you've determined as a team.\n\nGrumPHP has a set of common tasks built-in. You will be able to use GrumPHP with a minimum of configuration.\n\nWe don't want to bore you with all the details, so quick: install it yourself and unleash the power of GrumPHP!\n\n## Demo\n\u003cimg src=\"https://github.com/phpro/grumphp/wiki/images/demo.gif\" alt=\"demo\" width=\"100%\" /\u003e\n\n## Installation\n\nIn order for this package to work, you have to make sure following tools are discoverable on the command-line:\n\n- php\n- composer\n- git\n\nThis package is a composer plugin and should be installed to your project's dev dependency using composer:\n\nInstall GrumPHP as a phar without dependencies:\n```sh\ncomposer require --dev phpro/grumphp-shim\n```\n\nInstall GrumPHP with dependencies:\n```\ncomposer require --dev phpro/grumphp\n```\n\nInstall GrumPHP without dependencies and automated git hooks through phive\n```\nphive install grumphp\n```\n\nWhen the package is installed, GrumPHP will attach itself to the git hooks of your project.\nYou will see following message in the composer logs:\n\n*Watch out! GrumPHP is sniffing your commits!*\n\nGrumPHP will never push you into using a specific task. You can choose the tasks that fit your needs, and activate or\ndeactivate any task in no time! See the `suggest` section in [composer.json](https://github.com/phpro/grumphp/blob/master/composer.json#L50).\n\nNote: GrumPHP will overwrite existing hooks unless you run `composer install` with `--no-plugins` or `--no-scripts`.\nWe do create a backup of your git hook, but it's best to make sure you also have a backup of your custom hooks before you try to install GrumPHP.\n\nHaving trouble installing GrumPHP? Find out how to:\n\n- [Install globally](doc/installation/global.md)\n- [Install with an exotic project structure](doc/installation/exotic.md)\n\n## Configuration\n\nSome things in GrumPHP can be configured in a `grumphp.yml` or `grumphp.yml.dist` or `grumphp.dist.yml` file in the root of your project (the directory where you run the grumphp command).\nYou can specify a custom config filename and location in `composer.json` or in the `--config` option of the console commands.\n\n```yaml\n# grumphp.yml\ngrumphp:\n    hooks_dir: ~\n    hooks_preset: local\n    git_hook_variables:\n        VAGRANT_HOST_DIR: .\n        VAGRANT_PROJECT_DIR: /var/www\n        EXEC_GRUMPHP_COMMAND: exec\n        ENV: {}\n    stop_on_failure: false\n    ignore_unstaged_changes: false\n    hide_circumvention_tip: false\n    process_timeout: 60\n    ascii:\n        failed: grumphp-grumpy.txt\n        succeeded: grumphp-happy.txt\n    parallel:\n        enabled: true\n        max_workers: 32\n    fixer:\n        enabled: true\n        fix_by_default: false\n    environment:\n        files: []\n        variables: {}\n        paths: []\n    tasks: {}\n    testsuites: []\n    extensions: []\n```\n\nDetails of the configuration are broken down into the following sections.\n\n- [Parameters](doc/parameters.md) \u0026ndash; Configuration settings for GrumPHP itself.\n- [Tasks](doc/tasks.md) \u0026ndash; External tasks performing code validation and their respective configurations.\n- [TestSuites](doc/testsuites.md)\n- [Extensions](doc/extensions.md)\n- [Extending the TaskRunner](doc/runner.md)\n- [Conventions checker](doc/conventions.md)\n\n## Commands\n\nSince GrumPHP is just a CLI tool, these commands can be triggered:\n\n- [configure](doc/commands.md#installation)\n- [git:init](doc/commands.md#installation)\n- [git:deinit](doc/commands.md#installation)\n- [git:pre-commit](doc/commands.md#git-hooks)\n- [git:commit-msg](doc/commands.md#git-hooks)\n- [run](doc/commands.md#run)\n\n## Compatibility\n\nGrumPHP works with PHP 5.6 or above.\n\nThis package has been tested with following git clients:\n\n- CLI Unix\n- CLI Mac\n- CLI Windows\n- PhpStorm Git\n- Atlassian SourceTree\n- Syntevo SmartGit\n\n## Roadmap\n\nLots of tasks are already available to make sure your team writes great code.\nWe are always looking to support new tasks.\nFeel free to log an issue or create a pull request for a task we forgot.\n\nAre you missing a feature or did you find a bug?\nLog it in the [issue tracker](https://github.com/phpro/grumphp/issues)!\nWant to help out? Feel free to contact us!\n\n## FAQ\n- [FAQ](doc/faq.md)\n\n## About\n\n### Submitting bugs and feature requests\n\nBugs and feature request are tracked on [GitHub](https://github.com/phpro/grumphp/issues).\nPlease take a look at our rules before [contributing your code](CONTRIBUTING.md).\n\n### License\n\nGrumPHP is licensed under the [MIT License](LICENSE).\n","funding_links":[],"categories":["PHP","Projects using amphp","Uncategorized","目录","Table of Contents","代码分析 Code Analysis","Programming Languages","类库","Development","Dev Tools"],"sub_categories":["Tunnel","Uncategorized","代码分析 Code Analysis","Code Analysis","代码检查/静态分析","Quality Check","Libraries","PHP Dev Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpro%2Fgrumphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpro%2Fgrumphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpro%2Fgrumphp/lists"}