No release in over 3 years
Low commit activity in last 3 years
Danger plugin for PHP_CodeSniffer.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 2.14
= 3.0.7
>= 0
~> 10.0
~> 3.4
~> 0.63
~> 0.9

Runtime

 Project Readme

Gem Build Status

danger-php_codesniffer

Danger plugin for PHP_CodeSniffer.

Installation

$ gem install danger-php_codesniffer

Usage

Detect your PHP violations of a defined coding standard. The plugin will post a comment on PR/MR on your Github or Gitlab project.

Add this to your Dangerfile to run CodeSniffer:

php_codesniffer.exec

You can modify how the plugin behaves by adding one or more of the following options before the php_codesniffer.exec call:

Ignore file/path:

php_codesniffer.ignore = "./vendor"

Use specific coding standard:

php_codesniffer.standard = "CodeIgniter"

Only check new and modified file:

php_codesniffer.filtering = true

Fail the pipeline if CodeSniffer reports any errors (you also have to run Danger with the --fail-on-errors flag set to true):

php_codesniffer.fail_on_error = true

Development

  1. Clone this repo
  2. Run bundle install to setup dependencies.
  3. Run bundle exec rake spec to run the tests.
  4. Use bundle exec guard to automatically have tests run as you make changes.
  5. Make your changes.