From 2ab1528f96bc2bca8888c48c40b96f08e02d2f4e Mon Sep 17 00:00:00 2001 From: Kasper Garnaes Date: Mon, 7 Feb 2022 13:38:18 +0100 Subject: [PATCH] Core: Fix Drupal coding standard check on Scrutinizer A process is described at https://scrutinizer-ci.com/docs/tools/php/code-sniffer/#problems-with-drupal-coding-standard but that description does not work for us. Problems regarding a loading Sleevomat classes remain. Bases on the version history for the drupal/coder package we can tell that this dependency was introduced in version 8.3.14 of drupal/coder which was recently released. Scrutinizer will install version ^8.3 by default. To address this we pin coder to the last known working version. When using this approach third party packages will end up in ./vendor. We do not want to include this in our analysis so we configure PHPCS to ignore them. --- .scrutinizer.yml | 3 +++ phpcs.xml.dist | 1 + 2 files changed, 4 insertions(+) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 1e45f88ef1..40f3645c46 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,6 +1,9 @@ build: nodes: analysis: + dependencies: + after: + - composer require --dev drupal/coder:8.3.13 tests: override: - phpcs-run diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 2739a7854c..39d195aacc 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -3,6 +3,7 @@ PHP CodeSniffer configuration ding2. . + vendor/*