phpro / grumphp

A PHP code-quality tool
MIT License
4.14k stars 430 forks source link

grumphp git:init hooks not getting generated in project git folder #513

Closed m-dinesh-kumar closed 5 years ago

m-dinesh-kumar commented 6 years ago
Q A
Version GrumPHP version 0.14.1
Bug? yes
New feature? no
Question? yes
Documentation? no
Related tickets comma-separated list of related tickets

I am using Windows 8.1 and using Git Bash terminal. I installed Grumphp globally and added the path variable to the windows. I followed the instructions in the Global Installation url. The hooks are not getting initialized in the project folder, even with the grumphp git:init command. Is there any steps I am missing out?. The following are the steps for reproducing it

My configuration

# grumphp.yml
parameters:
    git_dir: .
    bin_dir: vendor/bin
    tasks: { git_commit_message: null, shell: null }

Steps to reproduce:

# Generate empty folder
mkdir tmp
cd tmp
git init
echo "vendor" > .gitignore
composer global require phpro/grumphp

# Your actions
# Please add the steps on how to reproduce the issue here.

# Run GrumpHP:
grumphp configure
Do you want to create a grumphp.yml file? [Yes]: Yes
In which folder is GIT initialized? [.]: .
Where can we find the executables? [vendor/bin]:
Which tasks do you want to run?
  [0 ] ant
  [1 ] atoum
  [2 ] behat
  [3 ] brunch
  [4 ] clover_coverage
  [5 ] codeception
  [6 ] composer
  [7 ] composer_require_checker
  [8 ] composer_script
  [9 ] deptrac
  [10] doctrine_orm
  [11] file_size
  [12] gherkin
  [13] git_blacklist
  [14] git_branch_name
  [15] git_commit_message
  [16] grunt
  [17] gulp
  [18] infection
  [19] jsonlint
  [20] kahlan
  [21] make
  [22] npm_script
  [23] phan
  [24] phing
  [25] php7cc
  [26] phpcpd
  [27] phpcs
  [28] phpcsfixer
  [29] phpcsfixer2
  [30] phplint
  [31] phpmd
  [32] phpmnd
  [33] phpparser
  [34] phpspec
  [35] phpstan
  [36] phpunit
  [37] phpversion
  [38] robo
  [39] securitychecker
  [40] shell
  [41] xmllint
  [42] yamllint
 > 15,40
GrumPHP is configured and ready to kick ass!

grumphp git:init

Result:

 [RuntimeException]
  Could not find hook template for pre-commit at ../../../../C:/Users/dineshk
  umar/AppData/Roaming/Composer/vendor/phpro/grumphp/resources/hooks/loca
  l\pre-commit.

Please let me know if additional inputs are required.

veewee commented 5 years ago

Since the path system got a rewrite in #644, I am closing this issue for now. Feel free to test that PR out and validate if it still works on your environment. A new release will follow soon-ish.