Skip to content

Commit

Permalink
Core: Fix Drupal coding standard check on Scrutinizer
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kasperg committed Feb 7, 2022
1 parent a80bee0 commit 2ab1528
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
build:
nodes:
analysis:
dependencies:
after:
- composer require --dev drupal/coder:8.3.13
tests:
override:
- phpcs-run
Expand Down
1 change: 1 addition & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<description>PHP CodeSniffer configuration ding2.</description>
<!-- Check all files in the current directory and below. -->
<file>.</file>
<exclude-pattern>vendor/*</exclude-pattern>
<arg name="extensions" value="php,module,inc,install,test,profile,theme,css,info,txt,md"/>
<config name="drupal_core_version" value="7"/>
<rule ref="Drupal"/>
Expand Down

0 comments on commit 2ab1528

Please sign in to comment.