#3310013: Add sniff to check and fix the order of Use statements is done, so Scheduler needs to have the Use statements ordered properly.

Issue fork scheduler-3357619

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

First, run with latest coder dev, to demonstrate the problem.

jonathan1055’s picture

The development version of Coder is being fetched successfully. But the list of sniffs read from Coders ruleset.xml is not being refreshed. The output in phpcs_sniffs.txt just has the original two

SlevomatCodingStandard (2 sniffs)
---------------------------------
  SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator
  SlevomatCodingStandard.PHP.ShortList

So how do we refresh this from the newly updated Coder source?

jonathan1055’s picture

I failed to get DrupalCI phpcs step to use the new sniff, even though the latest Coder dev version is loaded.

But now that Scheduler runs GitLab-CI pipelines we can see in this pipeline the failing PHPCS job, due to the three incorrectly ordered sniffs.

PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
------------------------------------------------------------------------------------
    SOURCE                                                                     COUNT
------------------------------------------------------------------------------------
[x] SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrdered  3
------------------------------------------------------------------------------------
A TOTAL OF 3 SNIFF VIOLATIONS WERE FOUND IN 1 SOURCE
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SOURCES AUTOMATICALLY (3 VIOLATIONS IN TOTAL)
------------------------------------------------------------------------------------

  • jonathan1055 committed ccbfba0e on 2.x
    Issue #3357619 by jonathan1055: New coding standard - Alphabetically...

  • jonathan1055 committed d854e920 on 8.x-1.x
    Issue #3357619 by jonathan1055: New coding standard - Alphabetically...
jonathan1055’s picture

Title: New coding standard - Alphabetically ordered USE statements » New coding standard - Alphabetically ordered Use statements
Status: Active » Fixed

Fixed in 2.x and 8.x-1.x

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.