Giter Club home page Giter Club logo

grumphp's Introduction

Build status Insight AppVeyor Installs Packagist Twitter Freenode

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

If you are trying to install GrumPHP on Windows: please read the windows pre-install section.

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

composer require --dev phpro/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!

To make GrumPHP even more awesome, it will suggest installing some extra packages:

  • behat/behat : ~3.0
  • codegyre/robo : ~0.7
  • fabpot/php-cs-fixer : ~1.10
  • malukenho/kawaii-gherkin : ~0.1
  • phing/phing : ~2.0
  • phpspec/phpspec : ~2.1
  • phpunit/phpunit : ~4.5
  • roave/security-advisories : dev-master@dev
  • squizlabs/php_codesniffer : ~2.3
  • codeception/codeception : ~2.1
  • sensiolabs/security-checker : ~3.0

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!

Having trouble installing GrumPHP? Find out how to:

Configuration

Some things in GrumPHP can be configured in a grumphp.yml or grumphp.yml.dist 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
parameters:
    bin_dir: "./vendor/bin"
    git_dir: "."
    hooks_dir: ~
    hooks_preset: local
    stop_on_failure: false
    ignore_unstaged_changes: false
    process_timeout: 60
    ascii:
        failed: grumphp-grumpy.txt
        succeeded: grumphp-happy.txt
    tasks:
        ant: ~
        behat: ~
        codeception: ~
        composer: ~
        gherkin: ~
        git_blacklist: ~
        git_commit_message: ~
        grunt: ~
        gulp: ~
        jsonlint: ~
        phing: ~
        phpcs: ~
        phpcsfixer: ~
        phpspec: ~
        phpunit: ~
        robo: ~
        securitychecker: ~
        shell: ~
        xmllint: ~
        yamllint: ~
    extensions: []

You can find a detailed overview of the configurable options in these sections:

Commands

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

Compatibility

GrumPHP works with PHP 5.3 or above, and is also tested to work with HHVM.

This package has been tested with following git clients:

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

Roadmap

Following tasks are still on the roadmap:

  • phpmd
  • phpcpd
  • phpdcd
  • twig lint
  • symfony validation
  • npm tests
  • humbug
  • ...

New features or bugfixes can be logged at the issue tracker. Want to help out? Feel free to contact us!

Build your own conventions checker

You can see an example of how to build your own conventions checker.

Solving issues

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 - see the LICENSE file for details

grumphp's People

Contributors

aaa2000 avatar adam-paterson avatar aderuwe avatar akira28 avatar big-shark avatar bilge avatar ecentinela avatar gerdemann avatar igormukhingmailcom avatar janvernieuwe avatar klipach avatar lykciv avatar mikechernev avatar mvhirsch avatar nousefreak avatar spekulatius avatar theratg avatar tombevers avatar toonjanssens avatar toonvd avatar veewee avatar wyrihaximus avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.