Download the PHP package andkirby/commithook without Composer
On this page you can find all versions of the php package andkirby/commithook. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package commithook
CmHook
CmHook is GIT commit hook the code validator for PHP (Code Sniffer), CSS (base only), JS (JsHint) code and commit message formatter/filler with the issue tracker integration (JIRA, GitHub).
The main purpose of this project is
- checking coding standards before commit (by using PHP CodeSniffer, JSHint, RuboCop, or any lint tool)
- filling up commit messages automatically to proper format (details)
Supported file types: php, phtml, js, coffee, css, scss, xml, sh, scss, css, json, less, html, htm.
The simplest commit message you could ever make
Target commit message:
This commit message will be generated automatically, we need to type only commit description:
See more details about short commit messages.
Installation
Latest release is v2.0.0-beta.47
Install globally
To get last beta version please define your minimum-stability
.
Due to reason the package requires one package which still in "dev", please fetch it first:
Now fetch the package:
Enable hooks in a project (with predefined configuration)
If a project already have base configuration files all what you need to:
-
define interpreters (PHP for PHPCS, Ruby for Rubocop, NodeJs for JSHint)
- PHP example:
(You may try to use PHP Windows Binaries Downloader (gist))
-
Install extra code validators:
-
PHPCS
- original).
- Rubocop installation.
-
- (optional) Perhaps, you have to define binaries for extra code validators in case they are not allow to use globally. (e.g. this example.)
-
Install GIT hook files
- Enable your tracker integration:
Sample .bashrc
Here is an example of .bashrc
file for global using.
Separate installation
If global way doesn't work you may use installation via create-project
.
Documentation references
Installation
Initialize configuration wizard
GIT integration: hook files installation
Password tracker update
Password update
Code validation
Ignore validation
Protect code
Enable JsHint validation (Javascript)
Commit message
Commit message format
Ignore commit message validation
Active task in commit message
Auto-explode commit message into the list
Problems
Bugs
Issue bugs list.
Code validators doesn't work with GIT cache
The code validation works with GIT but it doesn't support git cache. It means if you added a file (git add file.php
), changed it, and trying to commit (without adding it into GIT cache). In commit, of course, you will get code from cache but validators will validate your real file. (#113)
Minor bugs in short commit message
#32
Tips & tricks
Redundant gaps in code
You may quickly find gaps/trailing spaces in your code by the regular expression:
Just use it in your IDE.
OS environment
Tested on Windows in GIT Bash v2.9.
Feel free to create your faced issue.
Release notes
All versions of commithook with dependencies
rikby/console-helper Version ^0.11
rikby/crypter Version ~1.0@stable
symfony/console Version ~3.0@stable
symfony/filesystem Version ~2.5@stable
symfony/finder Version ~2.5@stable
chobie/jira-api-restclient Version ^2.0@dev
zendframework/zend-cache Version ~2.5@stable
knplabs/github-api Version ~1.4@stable