Fix code style and spelling errors

Created on 22 August 2024, 4 months ago
Updated 5 September 2024, 4 months ago

Problem/Motivation

Pipelines are failing due to phpcs and cspell errors:

--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 58 | ERROR | Parameter $ohdear_sdk is not described in comment
    |       | (Drupal.Commenting.FunctionComment.ParamMissingDefinition)
--------------------------------------------------------------------------------
FILE: ...stom/ohdear_integration-3312531/src/Commands/OhDearIntegrationCommands.php
--------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------
   9 | ERROR | [x] Use statements should be sorted alphabetically. The first
     |       |     wrong one is
     |       |     Drupal\Core\StringTranslation\StringTranslationTrait.
     |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
  88 | ERROR | [x] The first parameter of a multi-line function declaration
     |       |     must be on the line after the opening bracket
     |       |     (Drupal.Functions.MultiLineFunctionDeclaration.FirstParamSpacing)
  94 | ERROR | [x] Multi-line function declarations must have a trailing comma
     |       |     after the last parameter
     |       |     (Drupal.Functions.MultiLineFunctionDeclaration.MissingTrailingComma)
  94 | ERROR | [x] The closing parenthesis of a multi-line function declaration
     |       |     must be on a new line
     |       |     (Drupal.Functions.MultiLineFunctionDeclaration.CloseBracketLine)
 192 | ERROR | [x] The first parameter of a multi-line function declaration
     |       |     must be on the line after the opening bracket
     |       |     (Drupal.Functions.MultiLineFunctionDeclaration.FirstParamSpacing)
 194 | ERROR | [x] Multi-line function declarations must have a trailing comma
     |       |     after the last parameter
     |       |     (Drupal.Functions.MultiLineFunctionDeclaration.MissingTrailingComma)
 194 | ERROR | [x] The closing parenthesis of a multi-line function declaration
     |       |     must be on a new line
     |       |     (Drupal.Functions.MultiLineFunctionDeclaration.CloseBracketLine)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Time: 170ms; Memory: 6MB
PHP CODE SNIFFER REPORT SUMMARY
--------------------------------------------------------------------------------
FILE                                                            ERRORS  WARNINGS
--------------------------------------------------------------------------------
...egration-3312531/src/Commands/OhDearIntegrationCommands.php  7       0
...tion-3312531/src/Controller/OhDearIntegrationController.php  1       0
--------------------------------------------------------------------------------
A TOTAL OF 8 ERRORS AND 0 WARNINGS WERE FOUND IN 7 FILES
--------------------------------------------------------------------------------
PHPCBF CAN FIX 7 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
--------------------------------------------------------------------------------
    SOURCE                                                                 COUNT
--------------------------------------------------------------------------------
[x] Drupal.Functions.MultiLineFunctionDeclaration.CloseBracketLine         2
[x] Drupal.Functions.MultiLineFunctionDeclaration.FirstParamSpacing        2
[x] Drupal.Functions.MultiLineFunctionDeclaration.MissingTrailingComma     2
[ ] Drupal.Commenting.FunctionComment.ParamMissingDefinition               1
[x] SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.Incorrectl  1
--------------------------------------------------------------------------------
A TOTAL OF 8 SNIFF VIOLATIONS WERE FOUND IN 5 SOURCES
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SOURCES AUTOMATICALLY (7 VIOLATIONS IN TOTAL)
--------------------------------------------------------------------------------
=== This is _cspell_unrecognized_words.txt ===
Baaa
configuraton
ETABM
healtchecks
Healthcheck
healthcheck
Healthchecks
healthchecks
maintence
overridde
zcke

Proposed resolution

Fix phpcs errors and a list of skip words.

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇸🇮Slovenia useernamee Ljubljana

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @useernamee
  • Merge request !26Issue #3469661 "Fix code style" → (Merged) created by ankitv18
  • First commit to issue fork.
  • Pipeline finished with Failed
    4 months ago
    Total: 153s
    #261450
  • Status changed to Needs review 4 months ago
  • 🇮🇳India ankitv18

    Cspell and phpcs pipelines are fixed now ~~ please review MR!26

  • Status changed to Needs work 4 months ago
  • 🇮🇳India chandansha

    i have tested MR 26 and run phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig . this command i found some phpcs issue.
    also, pipeline failed test stage.

    FILE: /home/chandansha/docker/testd10/web/modules/custom/ohdear_integration-3469661/README.md
    ---------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ---------------------------------------------------------------------------------------------
      96 | WARNING | Line exceeds 80 characters; contains 88 characters
     100 | WARNING | Line exceeds 80 characters; contains 84 characters
    ---------------------------------------------------------------------------------------------
    
    
    FILE: /home/chandansha/docker/testd10/web/modules/custom/ohdear_integration-3469661/ohdear_integration.services.yml
    -------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------
     22 | ERROR | [x] Expected 1 newline at end of file; 2 found
    -------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/chandansha/docker/testd10/web/modules/custom/ohdear_integration-3469661/ohdear_integration.routing.yml
    ------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------
     7 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
    ------------------------------------------------------------------------------------------------------------------
    
    Time: 276ms; Memory: 12MB
    
  • 🇮🇳India ankitv18

    @chandansha have you even the checked the gitlab pipelines? https://git.drupalcode.org/issue/ohdear_integration-3469661/-/jobs/2519411

    Both cspell and phpcs are fixed now.

  • Status changed to Needs review 4 months ago
  • 🇮🇳India chandansha

    @ankitv18 i have checked pipeline it is fixed but in my local i found above issue.

  • 🇮🇳India ankitv18

    So there might be some configuration mismatch for sniffing out the code spell at your local. Please do check as of now Drupal follows gitlab template to execute the pipelines for validation and all the phpstan issues.

  • 🇸🇮Slovenia useernamee Ljubljana

    Looks good, merged.

  • Pipeline finished with Skipped
    4 months ago
    #261501
  • Status changed to Fixed 4 months ago
  • 🇸🇮Slovenia useernamee Ljubljana
  • 🇸🇮Slovenia useernamee Ljubljana

    I guess we now need a test fix for 2.x, and we're good.

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

Production build 0.71.5 2024