From decbc783422fcfc08f29b0230fcbafe95c2acc6d Mon Sep 17 00:00:00 2001 From: jrfnl Date: Mon, 29 Mar 2021 00:52:16 +0200 Subject: [PATCH] PHPCS: various improvements * PHPCS: add a PHPCS configuration file containing all the common command-line parameters. This file will be automatically picked up by PHPCS and can be overruled locally by a `[.]phpcs.xml` file. Includes downgrading the cyclomatic complexity error to a warning. * Ant: remove the configuration CLI arguments which are now contained in the `phpcs.xml.dist` file from the `build.xml` task configuration. * Ant: add a CLI argument which will ignore CS warnings when determining the exit code, but will still _show_ warnings in the report. Using this will also allow for enabling `failonerror` for the build step. * Git: Add the `phpcs.xml.dist` file to the `.gitattributes` file to be ignored when packaging a release. * Git: Add the potential local overload files to the `.gitignore` file. --- .gitattributes | 1 + .gitignore | 2 ++ build.xml | 6 ++---- phpcs.xml.dist | 21 +++++++++++++++++++++ 4 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 phpcs.xml.dist diff --git a/.gitattributes b/.gitattributes index f31138b..1bbc021 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,3 +5,4 @@ .travis.yml export-ignore build.xml export-ignore phpunit.xml.dist export-ignore +phpcs.xml.dist export-ignore diff --git a/.gitignore b/.gitignore index 35854b8..468ad40 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ /composer.lock phpunit.xml .phpunit.result.cache +.phpcs.xml +phpcs.xml diff --git a/build.xml b/build.xml index 9d95c2e..4f30c31 100644 --- a/build.xml +++ b/build.xml @@ -52,12 +52,10 @@ - - - + - + diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000..d07e229 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,21 @@ + + + A coding standard for Jakub Onderka's projects. + + ./src/ + + + + + + + + + + + + + + warning + +