PHPCS issue breaking CI

Created on 25 February 2024, 3 months ago
Updated 10 March 2024, 3 months ago

Problem/Motivation

PHPCS is failing due to a spacing issue in smart_trim.install

$ vendor/bin/phpcs --config-show installed_paths
Using config file: /builds/project/smart_trim/vendor/squizlabs/php_codesniffer/CodeSniffer.conf
installed_paths: ../../drupal/coder/coder_sniffer,../../sirbrillig/phpcs-variable-analysis,../../slevomat/coding-standard
$ vendor/bin/phpcs -i
The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, Drupal, DrupalPractice, VariableAnalysis and SlevomatCodingStandard
$ vendor/bin/phpcs -s $_WEB_ROOT/modules/custom --report-junit=junit.xml --report-full --report-summary --report-source
FILE: ...builds/project/smart_trim/web/modules/custom/smart_trim/smart_trim.install
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 8 | ERROR | [x] Expected strict_types=1, found strict_types = 1.
   |       |     (SlevomatCodingStandard.TypeHints.DeclareStrictTypes.IncorrectStrictTypesFormat)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Time: 349ms; Memory: 8MB
PHP CODE SNIFFER REPORT SUMMARY
--------------------------------------------------------------------------------
FILE                                                            ERRORS  WARNINGS
--------------------------------------------------------------------------------
...smart_trim/web/modules/custom/smart_trim/smart_trim.install  1       0
--------------------------------------------------------------------------------
A TOTAL OF 1 ERROR AND 0 WARNINGS WERE FOUND IN 15 FILES
--------------------------------------------------------------------------------
PHPCBF CAN FIX 1 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
--------------------------------------------------------------------------------
    SOURCE                                                                 COUNT
--------------------------------------------------------------------------------
[x] SlevomatCodingStandard.TypeHints.DeclareStrictTypes.IncorrectStrictTy  1
--------------------------------------------------------------------------------
A TOTAL OF 1 SNIFF VIOLATION WERE FOUND IN 1 SOURCE
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SOURCES AUTOMATICALLY (1 VIOLATIONS IN TOTAL)
--------------------------------------------------------------------------------

Proposed resolution

Fix spacing issue.

🐛 Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

🇺🇸United States markie Albuquerque, NM

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024