Shaarli NicolasMD !
Tag cloud
Picture wall
Daily
Plugins
  • ► Play Videos
RSS Feed
  • RSS Feed
  • Daily Feed
  • Weekly Feed
  • Monthly Feed
Filters

Links per page

  • 20 links
  • 50 links
  • 100 links

Filters

Untagged links
Note: Hook pre commit /shaare/j5MJ2Q
16/12/2016 11:08:06

run:

composer.phar global require friendsofphp/php-cs-fixer

add to .bashrc or .zshrc the following path

export PATH="$PATH:$HOME/.composer/vendor/bin"

reload sources:

source ~/.bashrc 
or
source ~/.zshrc

then add the following file in the ⁠⁠⁠.git/hooks⁠⁠⁠ folder of your current project
vim .git/hooks/pre-commit

#!/usr/bin/env bash

ROOT="/home/username/projects/project"

echo "########"
echo ""
echo "php-cs-fixer pre commit hook start"
echo ""
echo "########"

PHP_CS_FIXER="vendor/bin/php-cs-fixer"
HAS_PHP_CS_FIXER=false

if [ -x vendor/bin/php-cs-fixer ]; then
    HAS_PHP_CS_FIXER=true
fi

if $HAS_PHP_CS_FIXER; then
    $PHP_CS_FIXER fix --verbose;
fi

echo "########"
echo ""
echo "php-cs-fixer pre commit hook finish"
echo ""
echo "########"
php git
3727 links, including 251 private
Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Theme by kalvn