Coder Social home page Coder Social logo

grumphp's People

Contributors

1ed avatar aaa2000 avatar aderuwe avatar alessandroaussems avatar bertptrs avatar bilge avatar cafferata avatar danepowell avatar delboy1978uk avatar drupol avatar igormukhingmailcom avatar janvernieuwe avatar jerowork avatar joestewart avatar jreklund avatar jtubex avatar jyggen avatar kanti avatar landerstraeten avatar lykciv avatar mgeoffray avatar mitchellmckenna avatar oallain avatar poppabear8883 avatar prudloff-insite avatar qooplmao avatar tombevers avatar urguardian4ngel avatar veewee avatar yguedidi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grumphp's Issues

Error while running git

I'm not sure if it's grumphp error but just after installation ( composer require phpro/grumphp ) I get this error on each commit:

  [Gitonomy\Git\Exception\ProcessException]                                                                                                                                                          
  Error while running git:
  error: Could not expand include path '~/.gitcinclude'                                                                                                                                              
  fatal: bad config file line 49 in /usr/local/git/etc/gitconfig 

I've got grumphp 0.7.2 running on osx and my git config looks like this -> https://github.com/timcharper/git_osx_installer/blob/master/assets/etc/gitconfig.default

Windows support

GrumPHP is not working on Windows CLI. This is because composer installs bat files for every bin file.
Some actions need to be taken:

  • Remove the 'php' prefix in all process builders
  • Make sure every processbuilder uses the external CommandLocator
  • Check the OS in the CommandLocator and add .bat to the command if it is windows
  • Possibly there is also a path problem. Windows uses the backslash as directory separator, and unix uses the frontslash.

Extra installation checks:

  • We need to check if there is a git executable available. This could be handy in both windows as unix. If there is no git executable, an error message needs to be displayed and GrumPHP won't be hooked. Maybe we could take a look at the composer files to see how they resolve the git exectuable in windows.
  • We assume the php executable is available, otherwise composer won't be able to install it's packages.

PHP Fatal error: Cannot redeclare composerRequire

So I thought I'd give this a go after it was talked about at the the last Nomad Php Webinar I attended. I'm trying this on an empty project, the only code in my root that's not in my .gitignore is a readme.md, composer.json and grumphp.yml. On commit I get this error.

git commit
PHP Fatal error:  Cannot redeclare composerRequire6fe528f671e512f2b4fb01800c0ca522() (previously declared in /Users/xxx/yyy/zzz/vendor/composer/autoload_real.php:52) in /Users/xxx/yyy/zzz/vendor/composer/autoload_real.php on line 55

Fatal error: Cannot redeclare composerRequire6fe528f671e512f2b4fb01800c0ca522() (previously declared in /Users/xxx/yyy/zzz/vendor/composer/autoload_real.php:52) in /Users/xxx/yyy/zzz/vendor/composer/autoload_real.php on line 55

Add Formatters for specific Tasks

As mentioned in #14, the Task::run() method can be very large if custom formatting is added.
Therefor a Formatter interface will be available. It will look something like this:

interface Formatter 
{
    public function formatErrorMessage($output);
    public function formatSuccessMessage($output);
}

The implementation could also format success / error messages to a specific treshold.

Config file generator

After installing grumphp with composer, there needs to be a check if a grumphp.yml file exists.
If it does not exist an extra command needs to be executed. This command will load default values from composer.json and will try to guess the git path.
The resulting file will be placed in the composer directory.
This command will run before the git hook is added. This way, we can always be sure that the config file is pointing to the correct locations.

Blacklist keywords not working somehow

Hey guys,

For some reason i can still put my blacklisted keywords in my commit messages:

This is my grumpphp file

parameters:
    git_dir: .
    bin_dir: ./vendor/bin
    tasks:
        # Analyzes some PHP source code and tries to fix coding standards issues
        # Documentation for phpcsfixer: https://github.com/phpro/grumphp#php-cs-fixer
        # and for the used library PHP-CS-Fixer: https://github.com/FriendsOfPHP/PHP-CS-Fixer#usage
        phpcsfixer:
            level: "psr2"
            filters:
                #You can also blacklist the fixers you don't want by placing a dash in front of the fixer name, if this is more convenient
                - "-indentation"
                - "-elseif"
                - "-php_closing_tag"
        # The Phpcs task will sniff your code for bad coding standards.
        # Documentation for PHPCS https://github.com/phpro/grumphp#phpcs
        # ----
        # For now this task is commented because none of our theme classes are in namespaces and psr2 wants this.
        # ----
        phpcs:
            standard: "PSR2"
        # The Blacklist task will test your changes for blacklisted keywords in the commit messages
        # Documetation for blacklist https://github.com/phpro/grumphp#blacklist
        blacklist:
            keywords:
                - "die("
                - "var_dump("
                - "exit;"
                - " "
                - "global styling"
                - "spacings"
                - "test"

Here are some successfull commit messages:

commit 4828296a9b786fafbed7b0d9bbdfe4ba54ddf4c8
Author: Dennis Stolmeijer <*@hotmail.com>
Date:   Mon Nov 16 00:26:47 2015 +0100

    global styling

commit 3a754f42afdc78da4cd7dd0c35fa2ec19036e9c5
Author: Dennis Stolmeijer <*@hotmail.com>
Date:   Mon Nov 16 00:20:59 2015 +0100

    global styling

commit d185f76c52414fcdec01861d8b0e0b69421dd314
Author: Dennis Stolmeijer <*@hotmail.com>
Date:   Mon Nov 16 00:19:58 2015 +0100

    die()

commit d7cd48f4d94f106bb1000f84861b8afb24563d59
Author: Dennis Stolmeijer <*@hotmail.com>
Date:   Mon Nov 16 00:19:16 2015 +0100

    die()

Hope you guys can help me out

Mascot

We are planning to replace current ASCII art with a mascot.
A happy one when the tasks pass, a grumpy one when the tasks fail.
Here are 2 possible mascots. Note that the second one is based on a copyrighted image. Not sure how far we need to alter the mascot to use it.

Mascot 1:
2015-05-25 22 12 12

Mascot 2:
2015-05-25 22 12 03
Original image: http://phil-crash-murphy.deviantart.com/art/Hey-I-m-Grump-366700350

Class 'GrumPHP\Console\Application' not found

I tried to do a global install on a Windows 7 64-bit machine, but I am getting the error mentioned in the topic.

$ composer global require phpro/grumphp
Changed current directory to C:/Users/lasleh/AppData/Roaming/Composer
Using version ^0.5.1 for phpro/grumphp
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing gitonomy/gitlib (v0.1.7)
    Downloading: 100%

  - Installing doctrine/collections (v1.3.0)
    Loading from cache

  - Installing symfony/config (v2.7.6)
    Loading from cache

  - Installing symfony/dependency-injection (v2.7.6)
    Loading from cache

  - Installing symfony/yaml (v2.7.6)
    Loading from cache

  - Installing symfony/expression-language (v2.7.6)
    Downloading: 100%

  - Installing phpro/grumphp (v0.5.1)
    Downloading: 100%

symfony/dependency-injection suggests installing symfony/proxy-manager-bridge (Generate service proxies to lazy load them)
phpro/grumphp suggests installing behat/behat (Lets GrumPHP validate your project features.)
phpro/grumphp suggests installing phpspec/phpspec (Lets GrumPHP spec your code.)
phpro/grumphp suggests installing phpunit/phpunit (Lets GrumPHP run your unit tests.)
phpro/grumphp suggests installing squizlabs/php_codesniffer (Lets GrumPHP sniff on your code.)
phpro/grumphp suggests installing roave/security-advisories (Lets GrumPHP be sure that there are no known security issues.) Writing lock file
Generating autoload files

Created git hooks folder at: ./.git/hooks/
Watch out! GrumPHP is sniffing your commits!

lasleh@CPB2265
$ grumphp
PHP Fatal error:  Class 'GrumPHP\Console\Application' not found in C:\Users\lasleh\AppData\Roaming\Composer\vendor\phpro\grumphp\bin\grumphp on line 31

Fatal error: Class 'GrumPHP\Console\Application' not found in C:\Users\lasleh\AppData\Roaming\Composer\vendor\phpro\grumphp\bin\grumphp on line 31

Add 'blocking' flag to a Task in the TaskRunner

In a Task service it must be possible to add a "blocking" tag to the service configuration.
E.g.:

parameters:
    tasks:
        taskname:
            metadata:
                blocking: false

By default all tasks are blocking. A user can overwrite the task service to be non blocking.
When a task is blocking, the errors will be fatal and shown in red.
When a task is not blocking, the error will not be fatal. A yellow error message will be displayed, but the changes will be commited.

The blocking flag of a task should be read when a tasks fails.
The metadata functionallity is already available with the getTaskMetadata() method on the GrumPHP object.

More information: https://github.com/phpro/grumphp/blob/master/doc/tasks.md#metadata

Global grumphp or grumphp.phar (like phpunit)

Hello, thanks for your library.

I suggest add new feature - run hook by grumphp.phar

Advantages:

  • you don't need modify your composer
  • global check your code command
  • self-update packet

Add `stop_on_failure` flag

Currently all tasks will run, even if one task fails.
A parameter which makes it possible to fail early should be added..
For example:

parameters:
    stop_on_failure: true

By default this value is false.

Symfony 2.6 dependencies

In composer.json all Symfony components require version 2.6 or above, but a lot of projects use Symfony 2.3 (like mine) because it is an LTS release. Is it possible to downgrade component versions to 2.3?

Hook still present after removing GrumPHP

After removing GrumPHP with composer, the hook referring to the GrumPHP is still present. This prevents me from committing unless I remove the hook manually.

This can be annoying for people just trying out GrumPHP and they decide to remove it from their project.

Error on git dir

Grumphp expects that the git root is in the same folder as the vendor folder.

Directory structure:
–– app
–––– .git
–––– .gitignore
–––– src
–––––– grumphp.yml
–––––– vendor
–––––––– phpro
–––––––––– grumphp

Custom config.yml path at composer.json file extras

Hi guys.

That would be great if we can write some parameter at composer.json file extras that will be used at grumphp when it installed via composer install or added via composer require.

Something like this:

{
    "extra": {
        "grumphp": {
            "config-default-path": "vendor/our/package/path/to/config.yml"
        }
    }
}

Lets discuss and I will implement this.
Thanks.

[Proposal] Plugins

Context

I started building a similar library because I forgot this existed. I wanted to have a solution similar to Rocketeer which allowed people to create a directory in their project .githooks which contained a php config file with the tasks they wanted to do with particular git commands. The idea being companies can create their own plugins to do particular tasks. post-commit for example could post to a Slack channel, etc.

Misc Tasks

It would allow people to easily create their own tasks with classes or callbacks. For example I could have a task that did a test merge with the parent branch to check for an conflicts before I push.

Proposal

I don't want to reinvent the wheel and release a new library where 80% of the work is achieved with GrumPHP. But to make GrumPHP work how I'd like I'd need to refactor a lot of the structure. But it would allow users to specify only the plugins they required and have it all managed through composer as well as other tasks which might not have a library around them.

Any thoughts?

Check files in index/stage instead of working directory

Now GrumPHP check the index/stage for files changed as desired, but then is check for the content of these files in the working directory, so, you can modify these files locally without adding them to the index (e.g. for commit them) and GrumPHP will pass.

I don't know if is easy or even possible to check for content of the files but in the git index.

Continious Integration CLI command

It might be useful to use GrumPHP with CI servers like Jenkins.
An additional command needs to be created to run the tasks during Continious Integration.

Note that it should be possible to:

  • Skip specific files / folders like e.g. the vendor folder.
  • Add an optional threshold as a tag to the tasks services
  • Add the output of specific tasks to the Jenkins server.
  • ...

Global installation and wrong dependency autoload

When the installation of grumphp is global, a wrong dependency could be use by grumphp

Given a global installation of grumphp
Given a project with symfony/console=2.1.0 dependency
When I am in the project directory
And I run:
"""
grumphp run -c grumphp.yml
"""
Then I get the error:
"""
PHP Fatal error:  Call to undefined method Symfony\Component\Console\Helper\Helper::strlen() in /home/USER/.composer/vendor/symfony/console/Helper/ProgressBar.php on line 472
"""

bin/grumphp use the symfony/console=2.1.0 project dependency instead of global symfony/console dependency

At the moment, I do a hack in my global bin/grumphp to autoload only my global autoload

Invalid path after conversion at `git:init`

Hi.

After running command:

php ./vendor/bin/grumphp git:init --config=vendor/linkorb/convensions-checker/config/app/grumphp.yml

I have next .git/hooks/post-commit:

#!/bin/sh

#
# Run the hook command.
# Note: this will be replaced by the real command during copy.
#
(cd "./" && exec 'vendor/bin/grumphp' 'git:pre-commit' '--config=../../../../../..') # <------------ MUST BE something like '--config=vendor/linkorb/convensions-checker/config/app/grumphp.yml'
...

What i'm doing wrong?
Thank you.

Add codeception task

Would it be possible to add a Codeception task? It's one of the major testing frameworks with PHPUnit and PHPSpec, would love to have it in Grumphp

Composer warnings

During the composer task, warnings are triggered:

Running task 1/4: ComposerPHP Warning:  preg_match() expects parameter 2 to be string, object given in /Projects/phpro/grumphp/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php on line 67

Warning: preg_match() expects parameter 2 to be string, object given in /Projects/phpro/grumphp/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php on line 67
PHP Warning:  preg_match() expects parameter 2 to be string, object given in /Projects/phpro/grumphp/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php on line 67

Warning: preg_match() expects parameter 2 to be string, object given in /Projects/phpro/grumphp/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php on line 67
PHP Warning:  preg_match() expects parameter 2 to be string, object given in /Projects/phpro/grumphp/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php on line 67

Warning: preg_match() expects parameter 2 to be string, object given in /Projects/phpro/grumphp/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php on line 67
PHP Warning:  preg_match() expects parameter 2 to be string, object given in /Projects/phpro/grumphp/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php on line 67

Warning: preg_match() expects parameter 2 to be string, object given in /Projects/phpro/grumphp/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php on line 67
PHP Warning:  preg_match() expects parameter 2 to be string, object given in /Projects/phpro/grumphp/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php on line 67

Warning: preg_match() expects parameter 2 to be string, object given in /Projects/phpro/grumphp/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php on line 67
PHP Warning:  preg_match() expects parameter 2 to be string, object given in /Projects/phpro/grumphp/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php on line 67

Warning: preg_match() expects parameter 2 to be string, object given in /Projects/phpro/grumphp/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php on line 67

This does not occur during the run command, but does during a git:pre-commit command.

Split up the documentation

I think our README is becoming quite long and unwieldy to quickly navigate - I propose adding a separate folder for docs, where tasks can be documented separately and linking to those in the README.

I'll gladly do this if we're all agreed. :)

Autoloader loaded twice causing errors

I'm currently working on a package within the vendor folder of a project. So, if I run grumphp, the following autoloaders are loaded:

  • /var/www/[project]/vendor/[company]/[package]/vendor/autoload.php
  • /var/www/[project]/vendor/autoload.php

This is causing errors when using the package beberlei/assert in both the package and the project.

The following fixes the error, but I noticed the break was removed in this commit (b23f63c).

// bin/grumphp
foreach ($autoloadLocations as $autoload) {
    if (is_file($autoload)) {
        require_once($autoload);
        $loaded = true;
        break;
    }
}

Full output of the error:

$ php ./vendor/bin/grumphp run
PHP Fatal error:  Cannot redeclare Assert\that() (previously declared in /var/www/[project]/vendor/[company]/[package]/vendor/beberlei/assert/lib/Assert/functions.php:36) in /var/www/[project]/vendor/beberlei/assert/lib/Assert/functions.php on line 39
PHP Stack trace:
PHP   1. {main}() /var/www/[project]/vendor/[company]/[package]/vendor/phpro/grumphp/bin/grumphp:0
PHP   2. require_once() /var/www/[project]/vendor/[company]/[package]/vendor/phpro/grumphp/bin/grumphp:16
PHP   3. ComposerAutoloaderInit6549f0c697930168ee67730da82614b8::getLoader() /var/www/[project]/vendor/autoload.php:7
PHP   4. composerRequire6549f0c697930168ee67730da82614b8($file = *uninitialized*) /var/www/[project]/vendor/composer/autoload_real.php:45

Fatal error: Cannot redeclare Assert\that() (previously declared in /var/www/[project]/vendor/[company]/[package]/vendor/beberlei/assert/lib/Assert/functions.php:36) in /var/www/[project]/vendor/beberlei/assert/lib/Assert/functions.php on line 39

Call Stack:
    0.0006     228320   1. {main}() /var/www/[project]/vendor/[company]/[package]/vendor/phpro/grumphp/bin/grumphp:0
    0.0083     586808   2. require_once('/var/www/[project]/vendor/autoload.php') /var/www/[project]/vendor/[company]/[package]/vendor/phpro/grumphp/bin/grumphp:16
    0.0087     598408   3. ComposerAutoloaderInit6549f0c697930168ee67730da82614b8::getLoader() /var/www/[project]/vendor/autoload.php:7
    0.0239    1199256   4. composerRequire6549f0c697930168ee67730da82614b8(???) /var/www/[project]/vendor/composer/autoload_real.php:45

Create a wrapper for the ProcessBuilder

Currently the Task::run commands has many of these if statements:

if ($config['whatever']) { 
    $processBuilder->add(); 
}

It seems like a good idea to create a wrapper around the Symfony ProcessBuilder with following additional methods:

// Add an optional configuration option. This will not add anything if the config is empty
$wrapper->addOptionalAttribute('--config=%s', $config['config']); 
// Add a required configuration options. Throws exception when the config is empty
$wrapper->addRequiredAttribute('--config=%s', $config['config']);
// Clone the processbuilder wrapper
$wrapper->clone()

grumphp does not detect issues after changes

Hello,
I have installed grumphp as a new project and started playing with one file. The structure is as follows:

src/MyBundle/MyTestClass.php
vendor/
.gitignore
grumphp.yml
composer.json
composer.lock

my grumphp.yml

parameters:
  git_dir: .
  bin_dir: ./vendor/bin
  tasks:
    blacklist:
      keywords:
        - "die("
        - "var_dump("
        - "exit;"
    phpcs:
      standard: "vendor/leaphub/phpcs-symfony2-standard/leaphub/phpcs/Symfony2/"
    phpspec: ~
    phpcsfixer: ~

I have added phpcs to composer as per your README page.

When I run grumphp command line for first time, it works very well and detect any issues related to symfony2 coding standards or blacklist keywords:

php ./vendor/bin/grumphp git:pre-commit --config=grumphp.yml 

However if I make any change to MyTestClass.php file, it will not detect it after running the command again. Interestingly when I left the code for some time (around 1 hour) and ran it again it worked fine again! Also when I run phpcs directly from command line I am able to see if there is any issues with code so I suspect that there is caching or something that affects running tasks.

do you use any caching with grumphp?

my php code:

<?php
namespace File;




class MyTest_Class
{

    protected $nameValue;

    /**
     * @return mixed
     */
    public function getNameValue()
    {
        die();
        exit;

        return $this->nameValue;
    }

    /**
     * @param string $nameValue
     *
     * @return mixed
     */
    public function setNameValue($nameValue)
    {
        var_dump(null);

        return $nameValue;
    }
}

Fail when file is both in staging and not

Hi. First of all - nice tool ! ;)

Maybe it's a matter of configuration, but please consider the following scenario:

  • configure tool to use PHP CS Fixer, init git hooks
  • create foo.php file with CS violations
  • git add foo.php, git commit -m "foo" -> fails due to PHP CS Fixer violations
  • fix violations without adding the file (so git status will show unfixed-files in stage and fixed one in non-stage)
  • git commit -m "foo" will proceed, even if the file we are commiting is not valid

Please, could you help?

Display a progressbar while running the tasks

When the test-suite grows, the tasks will run longer. Therefor it might be nice to display a progressbar while the tasks are running.

More information about the progressbar helper:
http://symfony.com/doc/current/components/console/helpers/progressbar.html

How should this work:

  • The taskmanager should trigger some events: pre-run & post-run to specify which tasks ar running + the current context, pre-run-task to specify which task is running, post-run-task to tell the progressbar that a task has completed.
  • The console command helper should listen to those events and move the progress per task.
  • The output should be something like: 'running phpspec' Task 1/6

This feature will require some architecture changes which should be discussed before implementing.

Fix Phpcsfixer name

Please, could you fix the name of tool showed on precommit hook?
Proper one is PHP CS Fixer, or at least PhpCsFixer if you don't like spaces.

PHP-CS-Fixer fails when a file is checked but excluded through .php_cs file

First, thanks for your great work !

I faced a problem regarding PHP-CS-fixer and both pre-commit hook and run command.

When I exclude a file to be checked by cs-fixer through the .php_cs file, then execute the grumphp run command ( the excluded file is tracked ), it fails because actually when we provide a file path in the php-cs-fixer bin, it overwrites the .php_cs config

I created an issue in the php-cs-fixer project in order to maybe change this behavior.

I'm stuck with the run command as my CI server rejects all my builds.
My question is, do you think we could execute php-cs-fixer task without file name passed as argument when we execute the run command?

Relative paths on Windows Git Bash

Seems like there is some kind of problem with the relative paths in Git Bash and MINGW32 on Windows environments. It works if I place the absolute path to grumphp.yml, but I would rather not use that since it will break soon as somebody clones the repo to somewhere else. I tried various different options like "./" without help. I am using dev-master at the moment.

lasleh@CPB2265 /C
$ mkdir test

lasleh@CPB2265 /C
$ cd test

lasleh@CPB2265 /C/test
$ git init
Initialized empty Git repository in c:/test/.git/

lasleh@CPB2265 /C/test (master)
$ grumphp git:init

  [Symfony\Component\Filesystem\Exception\IOException]
  Failed to create "../../C:/test/.git/hooks/": mkdir(): Invalid argument.

Sort tasks by priority in the TaskRunner

In a Task service it must be possible to add a "priority" tag to the service configuration.
E.g.:

parameters:
    tasks:
        taskname:
            metadata:
                priority: 1000

The higher the priority, the earlier the task is executed.
The tasks will be sorted during runtime in the TasksCollection or in the TasksComilerPass.

The metadata functionallity is already available with the getTaskMetadata() method on the GrumPHP object.

More information: https://github.com/phpro/grumphp/blob/master/doc/tasks.md#metadata

No tasks runs when no files changed

Hi.

When I run php ./vendor/bin/grumphp git:pre-commit manually (and have no changed files) - I see green man even shouldn't. So, no tasks executed.

But tasks such as 'phpunit', 'phpspec', 'behat' need to be executed.

add --skip-success-output to commit-msg

The success and error messages are way to big and distracting, displaying the massive logo every time, the pre-commit hook can already skip this output, but the commit-msg does not have this option.

Maybe it would be best to make this configurable in grumphp.yml?

Grumphp failing with examples

In vagrant is succeeds in SourceTree it doesn't.

  1. When I run the ./bin/grumphp run command in my vagrant-env it returns all good.
  2. When I would like to commit with Sourcetree It returns the following:
GrumPHP detected a pre-commit command.
GrumPHP is sniffing your code!
Running task 1/1: Phpspec

/  skipped: 0%  /  pending: 0%  / passed: 100%  /  failed: 0%   /  broken: 0%   /  1 examples���������3 examples�����������30 examples�����������53 examples�����������99 examples�����������123 examples������������211 examples�����������52 examples�����������82 examples������������309 examples�����������96 examples������������406 examples�����������22 examples�����������41 examples�����������58 examples�����������67 examples�����������87 examples������������512 examples�����������43 examples�����������70 examples�����������98 examples������������627 examples
To skip commit checks, add -n or --no-verify flag to commit command
Completed with errors, see above

Because of this, I have to bypass the commit hooks.

I use the following environment:
OSX with PHP 5.5.29
Vagrant
SourceTree

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.