2017 © Pedro Peláez
 

library laravel-git-sniffer

An artisan command to check your code standards via pre-commit git hook.

image

avirdz/laravel-git-sniffer

An artisan command to check your code standards via pre-commit git hook.

  • Saturday, May 12, 2018
  • by avirdz
  • Repository
  • 1 Watchers
  • 1 Stars
  • 7,719 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 1 Open issues
  • 11 Versions
  • 10 % Grown

The README.md

laravel-git-sniffer

An artisan command to check your code standards via pre-commit git hook, (*1)

Install with composer

composer require avirdz/laravel-git-sniffer

Add the provider to app config (You don't need to do this if using Laravel >= 5.5)

Avirdz\LaravelGitSniffer\GitSnifferServiceProvider

Use artisan to publish the config

php artisan vendor:publish --provider="Avirdz\LaravelGitSniffer\GitSnifferServiceProvider" --tag=config

Run artisan command to copy the pre-commit hook

php artisan git-sniffer:copy

If you are working with other developers and you prefer each time that someone makes a clone and runs composer install, the hook is automatically copied, just add the copy command to the composer scripts, anyways it runs only on the defined environment, which by default is local., (*2)

"post-install-cmd": [
    "...laravel commands..."
    "php artisan git-sniffer:copy"
],

Config

Key Value Description
env (string) default: local The environment where the commands will be executed.
phpcs_bin (string) default: ./vendor/bin/phpcs bin for Php_CodeSniffer, installed as a dependency.
standard (string) default: PSR2 Code standard
encoding (string) default: utf-8 The encoding of your source files
extensions (array) default: php Valid php file extensions to check
phpcs_ignore (array) default: ./resources/views/* Blade templates are ignored by default
temp (string) default: .tmp_staging A temp directory where staged files will be copied
eslint_bin (string) bin for ESLint
eslint_config (string) Path to the eslintrc config file
eslint_extensions (array) default: js Valid js file extensions to check
eslint_ignore_path (string) Path to the .eslintignore file.

Note: Eslint ignores all hidden files and directories by default, since there is a temp staging folder and by default is hidden, you need to add it to the eslintignore files at the first line., (*3)

!.tmp_staging
otherfile.js

If you leave eslint_bin config empty it will be ignored, the same for phpcs_bin, but you need to configure at least one of them., (*4)

Resources

I'ts the same script just translated to php to work with laravel command. - Bash script: https://github.com/s0enke/git-hooks/tree/master/phpcs-pre-commit, (*5)

License

MIT, (*6)

The Versions

12/05 2018

dev-master

9999999-dev

An artisan command to check your code standards via pre-commit git hook.

  Sources   Download

MIT

The Requires

 

by Jesus Aviles

laravel hook git phpcs codesniffer pre-commit

12/05 2018

v1.3.0

1.3.0.0

An artisan command to check your code standards via pre-commit git hook.

  Sources   Download

MIT

The Requires

 

by Jesus Aviles

laravel hook git phpcs codesniffer pre-commit

07/02 2018

dev-update-laravel55

dev-update-laravel55

An artisan command to check your code standards via pre-commit git hook.

  Sources   Download

MIT

The Requires

 

by Jesus Aviles

laravel hook git phpcs codesniffer pre-commit

14/11 2017

v1.2.4

1.2.4.0

An artisan command to check your code standards via pre-commit git hook.

  Sources   Download

MIT

The Requires

 

by Jesus Aviles

laravel hook git phpcs codesniffer pre-commit

01/09 2017

v1.2.3

1.2.3.0

An artisan command to check your code standards via pre-commit git hook.

  Sources   Download

MIT

The Requires

 

by Jesus Aviles

laravel hook git phpcs codesniffer pre-commit

25/07 2017

v1.2.2

1.2.2.0

An artisan command to check your code standards via pre-commit git hook.

  Sources   Download

MIT

The Requires

 

by Jesus Aviles

laravel hook git phpcs codesniffer pre-commit

30/08 2016

v1.2.1

1.2.1.0

An artisan command to check your code standards via pre-commit git hook.

  Sources   Download

MIT

The Requires

 

by Jesus Aviles

laravel hook git phpcs codesniffer pre-commit

01/06 2016

v1.2.0

1.2.0.0

An artisan command to check your code standards via pre-commit git hook.

  Sources   Download

MIT

The Requires

 

by Jesus Aviles

laravel hook git phpcs codesniffer pre-commit

31/05 2016

v1.1.0

1.1.0.0

An artisan command to check your code standards via pre-commit git hook.

  Sources   Download

MIT

The Requires

 

by Jesus Aviles

laravel hook git phpcs codesniffer pre-commit

30/05 2016

dev-eslint-implementation

dev-eslint-implementation

An artisan command to check your code standards via pre-commit git hook.

  Sources   Download

MIT

The Requires

 

by Jesus Aviles

laravel hook git phpcs codesniffer pre-commit

27/05 2016

v1.0.0

1.0.0.0

An artisan command to check your code standards via pre-commit git hook.

  Sources   Download

MIT

The Requires

 

by Jesus Aviles

laravel hook git phpcs codesniffer pre-commit