All Projects → intaro → php-git-hooks

intaro / php-git-hooks

Licence: other
Git hooks for the local repository of the PHP project

Programming Languages

PHP
23972 projects - #3 most used programming language

Labels

Projects that are alternatives of or similar to php-git-hooks

Slimjim
SlimJim is a simple auto update script utilizing Slim (a PHP micro-framework), incron (inotify cron system), and GitHub/BitBucket post-receive-hook
Stars: ✭ 98 (+390%)
Mutual labels:  git-hooks
commithelper
A tool to create and lint commit messages
Stars: ✭ 35 (+75%)
Mutual labels:  git-hooks
pre-commit-hooks
git pre-commit hooks
Stars: ✭ 71 (+255%)
Mutual labels:  git-hooks
Wp Enforcer
Git hooks to encourage well-written WordPress.
Stars: ✭ 107 (+435%)
Mutual labels:  git-hooks
Simple Git Hooks
A simple git hooks manager for small projects
Stars: ✭ 179 (+795%)
Mutual labels:  git-hooks
precommit-hook
Automatically check your python code on every commit. 🔍 ✔️
Stars: ✭ 16 (-20%)
Mutual labels:  git-hooks
Talisman
By hooking into the pre-push hook provided by Git, Talisman validates the outgoing changeset for things that look suspicious - such as authorization tokens and private keys.
Stars: ✭ 1,155 (+5675%)
Mutual labels:  git-hooks
husky-elixir
🐶 Git hooks made easy
Stars: ✭ 47 (+135%)
Mutual labels:  git-hooks
Husky.Net
Git hooks made easy with Husky.Net internal task runner! 🐶 It brings the dev-dependency concept to the .NET world!
Stars: ✭ 394 (+1870%)
Mutual labels:  git-hooks
pre-commit-opa
Pre-commit git hooks for Open Policy Agent (OPA) and Rego development
Stars: ✭ 53 (+165%)
Mutual labels:  git-hooks
Git Good Commit
Git hook to help you write good commit messages, with no external dependencies.
Stars: ✭ 128 (+540%)
Mutual labels:  git-hooks
Yarnhook
Run `yarn install`, `npm install` or `pnpm install` on git hooks automatically
Stars: ✭ 177 (+785%)
Mutual labels:  git-hooks
prepare-commit-msg
Automatically prefix commit messages with the current branch issue number
Stars: ✭ 28 (+40%)
Mutual labels:  git-hooks
Git Guppy
Simple git-hook integration for your gulp workflows.
Stars: ✭ 105 (+425%)
Mutual labels:  git-hooks
run-if-changed
Run a command if a file changes via Git hooks
Stars: ✭ 25 (+25%)
Mutual labels:  git-hooks
Php Backslasher
[Git hook] Tool to add all PHP internal functions and constants to its namespace by adding backslash to them.
Stars: ✭ 79 (+295%)
Mutual labels:  git-hooks
pre-commit-hooks-safety
A pre-commit hook to check your Python dependencies against safety-db
Stars: ✭ 69 (+245%)
Mutual labels:  git-hooks
detect-secrets
A developer-friendly secrets detection tool for CI and pre-commit hooks based on Yelp's detect-secrets
Stars: ✭ 43 (+115%)
Mutual labels:  git-hooks
modern-office-git-diff
An experiment in tracking and diffing versions of modern Microsoft Office files in Git.
Stars: ✭ 51 (+155%)
Mutual labels:  git-hooks
captain-git-hook
✅ define git hooks as scripts in your package.json
Stars: ✭ 25 (+25%)
Mutual labels:  git-hooks

PHP Git Hooks

The Git hooks for applying in the local repository of the PHP project. Include the pre-commit hook.

Installation

Clone repository:

cd some/path
git clone https://github.com/intaro/php-git-hooks
cd php-git-hooks
php -r "readfile('https://getcomposer.org/installer');" | php
./composer.phar install

Make symlink to the pre-commit file:

cd some/symfony/project/.git/hooks
ln -s some/path/php-git-hooks/pre-commit pre-commit

pre-commit

Checks the committed files:

  • PHP Syntax on PHP-errors (with PHPLint)
  • Check code style for compliance with the standard PSR2

Based on pre-commit hook of Carlos Buenosvinos.

Example of output

$ git ci -m "commit message"
Intaro Code Quality Tool
Fetching files
Running PHPLint
Checking code style
1) src/Acme/DemoBundle/Tests/Controller/DefaultControllerTest.php (unused_use, eof_ending)

  [Exception]
  There are coding standards violations!
$ git ci -m "commit message"
Intaro Code Quality Tool
Fetching files
Running PHPLint
Checking code style
Checking code style with PHPCS
FILE: ...m/src/Acme/DemoBundle/Tests/Controller/DefaultControllerTest.php
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 2 WARNING(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
 197 | WARNING | Line exceeds 120 characters; contains 172 characters
 212 | WARNING | Line exceeds 120 characters; contains 128 characters
--------------------------------------------------------------------------------

  [Exception]
  There are PHPCS coding standards violations!
$ git ci -m "commit message"
Intaro Code Quality Tool
Fetching files
Running PHPLint
Checking code style
Checking code style with PHPCS
Good job dude!
[some-branch 0f5ea39] commit message
 10 files changed, 357 insertions(+), 17 deletions(-)
 create mode 120000 bin/php-cs-fixer
 create mode 120000 bin/phpcs
 create mode 100644 src/Acme/DemoBundle/Tests/Controller/DefaultControllerTest.php
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].