Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

The sniffs used in this patch have been selected from the reports on #3081785: [meta] Devel 8.x coding standards messages. Specifically I ran:

phpcbf . --sniffs=Drupal.Classes.ClassDeclaration,Drupal.Commenting.DocComment,Drupal.Commenting.DocCommentAlignment,Drupal.Commenting.DocCommentStar,Drupal.Commenting.FileComment,Drupal.Commenting.FunctionComment,Drupal.Commenting.InlineComment,Drupal.ControlStructures.ControlSignature,Drupal.Files.EndFileNewline,Drupal.Formatting.MultipleStatementAlignment,Drupal.Formatting.SpaceUnaryOperator,Drupal.WhiteSpace.OpenBracketSpacing,Drupal.WhiteSpace.OpenTagNewline,Drupal.WhiteSpace.OperatorSpacing,Drupal.WhiteSpace.ScopeIndent,Generic.PHP.LowerCaseKeyword,Generic.PHP.UpperCaseConstant,PSR2.Namespaces.NamespaceDeclaration,Squiz.ControlStructures.SwitchDeclaration,Squiz.Functions.FunctionDeclarationArgumentSpacing,Squiz.Functions.MultiLineFunctionDeclaration,Squiz.WhiteSpace.FunctionSpacing,Squiz.WhiteSpace.SuperfluousWhitespace

This outcome was: 472 errors fixed in 106 files. 442 insertions(+), 232 deletions(-)

I will not be surprised if one or two tests fail ...

jonathan1055’s picture

... well, no tests failed. This patch would leave us with under 1000 coding standards faults. The changes look reasonable to me.

jonathan1055’s picture

Re-run of the script from #2 gives:

A TOTAL OF 471 ERRORS WERE FIXED IN 104 FILES
104 files changed, 442 insertions(+), 231 deletions(-)

For these sniffs, after the files are changed, phpcs gives:

A TOTAL OF 770 ERRORS AND 0 WARNINGS WERE FOUND IN 90 FILES

Status: Needs review » Needs work

The last submitted patch, 4: 3098482-4.coding-standards-formatting.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

jonathan1055’s picture

Status: Needs work » Needs review
jonathan1055’s picture

Result on d.o. shows

936 coding standards messages
✓ 413 fewer than branch result

The 936 is probably just for the 104 files, so the overall total will be a bit higher when this is committed.

jonathan1055’s picture

New 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.

jonathan1055’s picture

944 coding standards messages
✓ 405 fewer than branch result

For 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.

  • jonathan1055 committed 38b9320 on 8.x-3.x
    Issue #3098482 by jonathan1055: Auto-fix coding standards for layout,...

  • jonathan1055 committed 339ed2b on 8.x-3.x
    Issue #3098482 by jonathan1055: Minor formatting fixes after manual tidy...
jonathan1055’s picture

Title: Auto-fix coding standards for formatting etc. » Auto-fix coding standards for layout, formatting, comment punctuation and whitespace
Status: Needs review » Fixed

This 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:

-----------------------------------------------------------
A TOTAL OF 768 ERRORS AND 0 WARNINGS WERE FOUND IN 89 FILES
-----------------------------------------------------------

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.

Status: Fixed » Closed (fixed)

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