Problem/Motivation

The coder project has now released version 8.3.2 with some new checks and sniffs. Drupal Core is currently using 8.3.1 so these new checks are not being run on core and contrib patches yet.

Proposed resolution

Update core/composer.json to require 8.3.2

Comments

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

Status: Active » Needs review
StatusFileSize
new484 bytes

Here's the path to core/composer.json

jonathan1055’s picture

StatusFileSize
new488 bytes

Try again, this time with a/ b/

jonathan1055’s picture

The problem in the console log is

Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package drupal/coder (locked at 8.3.1, required as ^8.3.2) is satisfiable by drupal/coder[8.3.1] but these conflict with your requirements or minimum-stability.

I did not update the composer.lock file - is that also required in the patch?

andypost’s picture

Status: Needs review » Needs work

Yes, lock file should be updated as well

kim.pepper’s picture

Status: Needs work » Needs review
StatusFileSize
new2.71 KB
new3.2 KB

Here's the composer.lock file.

jonathan1055’s picture

StatusFileSize
new4.08 KB

Thanks for the composer.lock update @kim.pepper. So now we get

Package operations: 0 installs, 2 updates, 0 removals
  - Updating squizlabs/php_codesniffer (3.4.1 => 3.4.2)
  - Updating drupal/coder (8.3.1 => 8.3.2):  Checking out 44c80c2107

which is good. The tests all pass.

The new sniffs do not automatically get run, they need to be added to core/phpcs.xml.dist, so here is that change added, and I will expect lots of coding standards failures now. I have only added the two new sniffs I wrote Drupal.Commenting.Deprecated and Drupal.Semanitcs.FunctionTriggerError. There may be other new sniffs, but they can be tested later.

[edit: I noticed a typo in my patch Commenting.DeprecatedSniff should be Commenting.Deprecated so that may cause a failure, or at minimum that sniff will not be run]

jonathan1055’s picture

StatusFileSize
new4.08 KB

Cancelled the test in #7 as I noticed

Executing PHPCS.
ERROR: Referenced sniff "Drupal.Commenting.DeprecatedSniff" does not exist

Here is the corrected patch.

jonathan1055’s picture

StatusFileSize
new4.08 KB

Fixing typo. Sorry for the noise. I can't run this locally at the moment, so my errors are not spotted until running on d.o.

alexpott’s picture

Status: Needs review » Needs work
+++ b/core/phpcs.xml.dist
@@ -42,6 +42,7 @@
+  <rule ref="Drupal.Commenting.Deprecated"/>

@@ -124,6 +125,7 @@
+  <rule ref="Drupal.Semantics.FunctionTriggerError"/>

We shouldn't be adding these here - otherwise we have to fix them here. We need to update the package here and then add issues to address each of these.

Core should always pass its coder configuration.

alexpott’s picture

Status: Needs work » Needs review
StatusFileSize
new1.63 KB
new3.94 KB

composer changes done by doing: composer update drupal/coder squizlabs/php_codesniffer

the vfsstream files appear to have moved... but that is part of composer upd`ate so all good imo.

jonathan1055’s picture

Thanks alexpott

Core should always pass its coder configuration.

Yes I knew that. But now I see what you mean, create separate issues to test each new sniff and fix it. I was just trying to see what failures we had here.

1744 standards violations is a nice nig number to work on :-)

jonathan1055’s picture

naveenvalecha’s picture

Status: Needs review » Reviewed & tested by the community

Looks good. Thanks!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 340d33e and pushed to 8.8.x. Thanks!

Given that I did not write this patch - it's the result of composer update - I've committed it to 8.8.x so we can start of the bigger issues of actually adding and fixing the new sniffs.

  • alexpott committed 340d33e on 8.8.x
    Issue #3048244 by jonathan1055, alexpott, kim.pepper: Update the stable...
jonathan1055’s picture

Status: Fixed » Needs review

Thanks @alexpott for the commit. Yes, now we can work on the actual core fixes.

alexpott’s picture

Status: Needs review » Fixed
jonathan1055’s picture

ha. I did not mean to change that status. Must have been a stale form that I posted to, without doing a refresh (which seems odd because I reloaded the page to see your commit). Anyway, thanks for resetting to fixed.

jonathan1055’s picture

Issue summary: View changes

Fixed typo in issue summary and removed remaining tasks which are now covered in other issues.

Status: Fixed » Closed (fixed)

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