Retour au classement

phpro/grumphp

PHP

A PHP code-quality tool

code-qualityphpgit-hookscomposer-pluginhacktoberfest
Croissance des étoiles
Étoiles
4.3k
Forks
448
Croissance hebdomadaire
Issues
4
2k4k
janv. 2023mars 2024mai 2025juil. 2026
ArtefactsPackagistcomposer require phpro/grumphp
README

Github Actions AppVeyor Installs Packagist

Twitter Join the chat at https://gitter.im/phpro/grumphp

GrumPHP

Sick and tired of defending code quality over and over again? GrumPHP will do it for you! This composer plugin will register some git hooks in your package repository. When somebody commits changes, GrumPHP will run some tests on the committed code. If the tests fail, you won't be able to commit your changes. This 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.

GrumPHP has a set of common tasks built-in. You will be able to use GrumPHP with a minimum of configuration.

We don't want to bore you with all the details, so quick: install it yourself and unleash the power of GrumPHP!

Demo

demo

Installation

In order for this package to work, you have to make sure following tools are discoverable on the command-line:

  • php
  • composer
  • git

This package is a composer plugin and should be installed to your project's dev dependency using composer:

Install GrumPHP as a phar without dependencies:

composer require --dev phpro/grumphp-shim

Install GrumPHP with dependencies:

composer require --dev phpro/grumphp

Install GrumPHP without dependencies and automated git hooks through phive

phive install grumphp

When the package is installed, GrumPHP will attach itself to the git hooks of your project. You will see following message in the composer logs:

Watch out! GrumPHP is sniffing your commits!

GrumPHP will never push you into using a specific task. You can choose the tasks that fit your needs, and activate or deactivate any task in no time! See the suggest section in composer.json.

Note: GrumPHP will overwrite existing hooks unless you run composer install with --no-plugins or --no-scripts. We 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.

Having trouble installing GrumPHP? Find out how to:

Configuration

Some 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). You can specify a custom config filename and location in composer.json or in the --config option of the console commands.

# 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: []

Details of the configuration are broken down into the following sections.

Commands

Since GrumPHP is just a CLI tool, these commands can be triggered:

Compatibility

GrumPHP works with PHP 5.6 or above.

This package has been tested with following git clients:

  • CLI Unix
  • CLI Mac
  • CLI Windows
  • PhpStorm Git
  • Atlassian SourceTree
  • Syntevo SmartGit

Roadmap

Lots of tasks are already available to make sure your team writes great code. We are always looking to support new tasks. Feel free to log an issue or create a pull request for a task we forgot.

Are you missing a feature or did you find a bug? Log it in the issue tracker! Want to help out? Feel free to contact us!

FAQ

About

Submitting bugs and feature requests

Bugs and feature request are tracked on GitHub. Please take a look at our rules before contributing your code.

License

GrumPHP is licensed under the MIT License.

Dépôts similaires
usestrix/strix

Open-source AI penetration testing tool to find and fix your app’s vulnerabilities.

PythonPyPIApache License 2.0agentsartificial-intelligence
strix.ai
43.2k4.5k
realm/SwiftLint

A tool to enforce Swift style and conventions.

SwiftMIT Licenselinterlinting
realm.github.io/SwiftLint
19.7k2.3k
keploy/keploy

Open-source platform for creating safe, isolated production sandboxes for API, integration, and E2E testing.

GoGo ModulesApache License 2.0testingtest-automation
keploy.io
18.3k2.3k
federico-busato/Modern-CPP-Programming

Modern C++ Programming Course (C++03/11/14/17/20/23/26)

HTMLCreative Commons Attribution Share Alike 4.0 Internationalcppcpp11
federico-busato.github.io/Modern-CPP-Programming/
15.9k1.1k
facebook/infer

A static analyzer for Java, C, C++, and Objective-C

OCamlMIT Licensestatic-analysisstatic-code-analysis
fbinfer.com
15.7k2.1k
analysis-tools-dev/static-analysis

⚙️ A curated list of static analysis (SAST) tools and linters for all programming languages, config files, build tools, and more. The focus is on tools which improve code quality.

Rustcrates.ioMIT Licensestatic-analysisstatic-analyzers
analysis-tools.dev
14.7k1.5k
Kristories/awesome-guidelines

Programming style, best practices, and coding conventions.

JavaScriptnpmCreative Commons Zero v1.0 Universalawesomeguidelines
11k619
SonarSource/sonarqube

Continuous Inspection

JavaMavenGNU Lesser General Public License v3.0sonarqubecode-quality
sonarqube.org
10.8k2.2k
super-linter/super-linter

Combination of multiple linters to run as a GitHub Action or standalone

ShellMIT Licenselinteractions
github.com/super-linter/super-linter
10.5k1.1k
CodingDocs/awesome-java

Collection of awesome Java project on Github(非常棒的 Java 开源项目集合).

awesome-listcode-quality
9.6k1.6k
reviewdog/reviewdog

🐶 Automated code review tool integrated with any code analysis tools regardless of programming language

GoGo ModulesMIT Licenselintergo
medium.com/@haya14busa/reviewdog-a-code-review-dog-who-keeps-your-codebase-healthy-d957c471938b
9.5k489
checkstyle/checkstyle

Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. By default it supports the Google Java Style Guide and Sun Code Conventions, but is highly configurable. It can be invoked with an ANT task and a command line program.

JavaMavenGNU Lesser General Public License v2.1javastatic-code-analysis
checkstyle.org
9k4.1k