Skip to content

Commit

Permalink
Change sha to rev to conform to updated pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
FatherShawn committed Apr 21, 2020
1 parent a66d96f commit 87345dc
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,15 @@ Pre-commit scripts appropriate for *any* PHP project. These hooks are made as cu

# Setup

Just add to your `.pre-commit-config.yaml` file with the following

```yaml
- repo: https://github.com/digitalpulp/pre-commit-php.git
sha: 1.4.0
hooks:
- id: php-lint
- id: php-unit
- id: php-cs
files: \.(php)$
args: [--standard=PSR1 -p]
- id: php-cbf
files: \.(php)$
args: [--standard=PSR1 -p]
```
See (Adding pre-commit plugins to your project)[https://pre-commit.com/#adding-pre-commit-plugins-to-your-project]

# Supported Hooks

## php-lint

```yaml
- repo: https://github.com/digitalpulp/pre-commit-php.git
sha: 1.4.0
rev: 1.4.0
hooks:
- id: php-lint
```
Expand All @@ -37,7 +23,7 @@ A bash script that runs `php -l` against stage files that are php. Assumes `php`

```yaml
- repo: https://github.com/digitalpulp/pre-commit-php.git
sha: 1.4.0
rev: 1.4.0
hooks:
- id: php-lint-all
```
Expand All @@ -49,7 +35,7 @@ A systems hook that just runs `php -l` against stage files that have the `.php`

```yaml
- repo: https://github.com/digitalpulp/pre-commit-php.git
sha: 1.4.0
rev: 1.4.0
hooks:
- id: php-unit
```
Expand All @@ -65,7 +51,7 @@ Note in its current state, it will run the whole PHPUnit test as along as `.php`

```yaml
- repo: https://github.com/digitalpulp/pre-commit-php.git
sha: 1.4.0
rev: 1.4.0
hooks:
- id: php-cs
files: \.(php)$
Expand All @@ -82,7 +68,7 @@ The `args` property in your hook declaration can be used for pass any valid PHP

```yaml
- repo: https://github.com/digitalpulp/pre-commit-php.git
sha: 1.4.0
rev: 1.4.0
hooks:
- id: php-cs
files: \.(php)$
Expand All @@ -98,7 +84,7 @@ If you have multiple standards or a comma in your `args` property, escape the co

```yaml
- repo: https://github.com/digitalpulp/pre-commit-php.git
sha: 1.4.0
rev: 1.4.0
hooks:
- id: php-cs
files: \.(php)$
Expand All @@ -110,7 +96,7 @@ To install PHP Codesniffer (phpcs & phpcbf), follow the [recommended steps here]
## php-cs-fixer
```yaml
-- repo: https://github.com/digitalpulp/pre-commit-php.git
sha: 1.4.0
rev: 1.4.0
hooks:
- id: php-cs-fixer
files: \.(php)$
Expand All @@ -128,7 +114,7 @@ Adds the (PHPStan)[https://phpstan.org/] tool.

```yaml
-- repo: https://github.com/digitalpulp/pre-commit-php.git
sha: 1.4.0
rev: 1.4.0
hooks:
- id: php-stan
files: \.(php)$
Expand Down

0 comments on commit 87345dc

Please sign in to comment.