agentsquidflaps/pre-commit

Automate code standards on commit

Installs: 14

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:Shell

Type:scripts

1.0.1 2020-09-08 10:53 UTC

This package is auto-updated.

Last update: 2024-11-08 20:07:23 UTC


README

Heavily inspired by smgladkovskiy/phpcs-git-pre-commit

About

Run php linting, code beautifier and code sniffer automatically to the PS2 standard. This differs from smgladkovskiy/phpcs-git-pre-commit only in that it runs phpcbf in addition to phpcs.

Install

composer require --dev "agentsquidflaps/pre-commit"

To enable code sniff, аdd to post-install-cmd and post-update-cmd in composer.json installation script:

"scripts": {
    "install-hooks": ["sh ./vendor/agentsquidflaps/pre-commit/src/setup.sh"],
    "post-install-cmd": ["@install-hooks"],
    "post-update-cmd": ["@install-hooks"]
}

Then run composer install or composer update. pre-commit hook will be installed or updated.