Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Many coding standards violations can be fixed using PHPCBF auto-fixer. The sniffs used here should only change the layout, formatting, comment punctuation, whitespace.
Comment | File | Size | Author |
---|
Comments
Comment #2
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThe sniffs used in this patch have been selected from the reports on #3081785: [meta] Devel 8.x coding standards messages. Specifically I ran:
This outcome was: 472 errors fixed in 106 files. 442 insertions(+), 232 deletions(-)
I will not be surprised if one or two tests fail ...
Comment #3
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commented... well, no tests failed. This patch would leave us with under 1000 coding standards faults. The changes look reasonable to me.
Comment #4
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedRe-run of the script from #2 gives:
For these sniffs, after the files are changed, phpcs gives:
Comment #6
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedha ha, caught by #3097047: Random test failure in DevelSwitchUserTest - User "admin" is included in the switch user list (but not for much longer).
Re-queueing
Comment #7
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedResult on d.o. shows
The 936 is probably just for the 104 files, so the overall total will be a bit higher when this is committed.
Comment #8
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedNew patch, plus text file of the phpcs and phpcbf output for the record. I have read through the full diff, and made manual changes to a few fixes where the automated fix only went part way to correcting the fault. All looks OK, so if this patch passes I will commit it. There are a few recent issues which have patches that will no longer apply and will require a re-roll, but we have to accept that, as it is always going to be the case.
Comment #9
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedFor the record I have saved and uploaded here the coding standards report for patch #8 as these results are not stored on drupal.org after a few days.
Comment #12
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThis issue can be marked 'fixed' because it was specifically for the automatic fixes using the sniffs listed above. There are still coding standards faults reported by these sniffs but these are not auto-fixable. Using --report=summary for these sniffs gives now gives:
Before these commits the branch results at 8.8 and 8.9 had 1,709 coding standards message, now the total is 1,261 which is a drop of 448.