You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A script to run[PHP Coding Standards Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) before committing code.
3
+
A script that runs[PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) before committing code.
4
4
5
-
The fixer is run **quietly** to avoid unnecessary noise when committing code. If there are violations it is run again in verbose mode to provide more information about the violations in the commit.
5
+
The fixer is **run quietly** to avoid any output. If there are violations it is run again in verbose mode to provide information about the violations.
6
6
7
-
A full check is executed if the configuration or the Composer lock file has changed, otherwise only changed files since the last commit are checked.
7
+
Only **changed files** since the the last commit are checked unless configuration files that might impact all files are changed, in which case a full check is done.
8
8
9
-
This hook is invoked by git-commit, and [can be bypassed](https://git-scm.com/docs/githooks#_pre_commit) with the --no-verify option.
9
+
The hook is invoked by `gitcommit`, and [can be bypassed](https://git-scm.com/docs/githooks#_pre_commit) with the `--no-verify` option.
10
10
11
-
```
11
+
```sh
12
12
git commit --no-verify
13
13
```
14
14
15
15
## Installation
16
16
17
-
Create a Git hooks directory:
17
+
Create the hooks directory:
18
18
19
-
mkdir ~/.githooks
19
+
```sh
20
+
mkdir ~/.githooks
21
+
```
20
22
21
-
Download the `pre-commit`hook to:
23
+
Download or copy the `pre-commit`script to:
22
24
23
-
~/.githooks/pre-commit
25
+
```sh
26
+
~/.githooks/pre-commit
27
+
```
24
28
25
29
Make sure the file is executable:
26
30
27
-
chmod 744 ~/.githooks/pre-commit
31
+
```sh
32
+
chmod 744 ~/.githooks/pre-commit
33
+
```
28
34
29
35
Configure the Git [hooks path](https://git-scm.com/docs/git-config#Documentation/git-config.txt-corehooksPath):
0 commit comments