From f955d7abb79627afd01ad1271c4e3aafa166765f Mon Sep 17 00:00:00 2001 From: jrfnl Date: Wed, 15 Jan 2020 23:01:28 +0100 Subject: [PATCH 1/2] PHPCS: document run parameters in project ruleset This makes it easier to run the PHPCS command for the project. Includes: * Adding the `Tests` directory to the run - excluding the test case files in `fixtures`. * Cleaning up the result report by using the `basepath` configuration. * Making the run faster by using `parallel` scanning if available, --- composer.json | 4 ++-- phpcs.xml.dist | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index dfe8bea7..044acc87 100644 --- a/composer.json +++ b/composer.json @@ -30,8 +30,8 @@ "prefer-stable": true, "scripts": { "test": "./vendor/bin/phpunit", - "lint": "./vendor/bin/phpcs -s -p VariableAnalysis/Sniffs VariableAnalysis/Lib", - "lint-self": "./vendor/bin/phpcs --standard=./VariableAnalysis -s -p VariableAnalysis/Sniffs VariableAnalysis/Lib", + "lint": "./vendor/bin/phpcs", + "lint-self": "./vendor/bin/phpcs --standard=./VariableAnalysis", "phpstan": "./vendor/bin/phpstan analyse -l 7 VariableAnalysis" }, "require" : { diff --git a/phpcs.xml.dist b/phpcs.xml.dist index f7b8bcd2..5805b773 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -6,6 +6,23 @@ - bracers on end of line instead new line - two space indentation + + ./VariableAnalysis/ + ./VariableAnalysis/Tests/CodeAnalysis/fixtures/ + + + + + + + + + + + + + + From e753cbcd9002d064bc5dbaf8350684fd02d9516d Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 17 Jan 2020 20:48:20 +0100 Subject: [PATCH 2/2] Composer: remove `lint-self` and add ruleset to the PHPCS config instead --- .circleci/config.yml | 1 - composer.json | 1 - phpcs.xml.dist | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8de7e4fb..6c639f4a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,6 @@ jobs: - run: COMPOSER=composer.json composer test - run: COMPOSER=composer.json composer phpstan - run: COMPOSER=composer.json composer lint - - run: COMPOSER=composer.json composer lint-self build_php5: docker: - image: circleci/php:5.6.40-zts-stretch-node-browsers-legacy diff --git a/composer.json b/composer.json index 044acc87..5179aab6 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,6 @@ "scripts": { "test": "./vendor/bin/phpunit", "lint": "./vendor/bin/phpcs", - "lint-self": "./vendor/bin/phpcs --standard=./VariableAnalysis", "phpstan": "./vendor/bin/phpstan analyse -l 7 VariableAnalysis" }, "require" : { diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 5805b773..745cf48b 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -48,4 +48,5 @@ +