2017 © Pedro Peláez
 

library symfony-pre-commit

A Symfony pre-commit hook

image

hgtan/symfony-pre-commit

A Symfony pre-commit hook

  • Friday, July 3, 2015
  • by hoangthienan
  • Repository
  • 2 Watchers
  • 7 Stars
  • 1,173 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 1 Versions
  • 4 % Grown

The README.md

# A Symfony pre commit hook

Checks in our pre-commit hook, (*1)

  • Syntax check with php lint (“php -l”): We check every committed file has a valid PHP syntax.
  • Sync check of composer.json and composer.lock files: We check these two files are committed together in order to avoid committing the json but not the lock and generate some issue to another developers.
  • PHP CS Fixer check: With the –dry-run parameter it does not fix, just say what the problems are. With the –fixers parameter you can control what fixers you want to execute.
  • PHP Code Sniffer check: Same as before, but another rule that checks another rules.
  • PHPMD: We have enabled the controversial rules.
  • Unit Testing check: We run around 3.000 tests right now.

INSTALLATION:, (*2)

Latest Stable Version Total Downloads Latest Unstable Version License, (*3)

SensioLabsInsight, (*4)

This library is available on Packagist. The recommended way to install this library is through Composer:, (*5)

add hgtan/symfony-pre-commit as a composer dependency., (*6)

composer.json, (*7)

"require-dev": {
    ...
    "hgtan/symfony-pre-commit": "dev-master"
}
php composer.phar update hgtan/symfony-pre-commit

USAGE:, (*8)

When a developer clones the project, it just needs to:, (*9)

-- linux
cd [project]
rm -rf .git/hooks
ln -s ../vendor/hgtan/symfony-pre-commit/hooks .git/hooks

-- windows
cd [project]
rd .git\hooks
mklink /D /J .git\hooks vendor\hgtan\symfony-pre-commit\hooks

Remembering to set up the hooks, (*10)

"scripts": {
    "pre-update-cmd": "Hgtan\\Composer\\Script\\Hooks::checkHooks",
    "pre-install-cmd": "Hgtan\\Composer\\Script\\Hooks::checkHooks"
}

Have a look at Write your git hooks in PHP and keep them under git control for more usage information., (*11)

The Versions

03/07 2015

dev-master

9999999-dev https://github.com/hoangthienan/symfony-pre-commit

A Symfony pre-commit hook

  Sources   Download

MIT