Fix the issues reported by phpcs

Created on 12 May 2023, about 1 year ago
Updated 21 April 2024, 2 months ago

GitLab CI shows the following warnings/errors which should be fixed.

FILE: ...ue/trapadata-3360082/web/modules/custom/trapadata-3360082/trapadata.module
--------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 8 LINES
--------------------------------------------------------------------------------
  1 | ERROR | [x] Missing file doc comment
    |       |     (Drupal.Commenting.FileComment.Missing)
 33 | ERROR | [x] Expected 1 blank line after function; 0 found
    |       |     (Squiz.WhiteSpace.FunctionSpacing.After)
 37 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced
    |       |     with use statements
    |       |     (Drupal.Classes.FullyQualifiedNamespace.UseStatementMissing)
 38 | ERROR | [x] Whitespace found at end of line
    |       |     (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)
 39 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
    |       |     (Drupal.Commenting.InlineComment.WrongStyle)
 42 | ERROR | [x] Short array syntax must be used to define arrays
    |       |     (Drupal.Arrays.DisallowLongArraySyntax.Found)
 47 | ERROR | [x] Case breaking statement indented incorrectly; expected 6
    |       |     spaces, found 5
    |       |     (Drupal.WhiteSpace.ScopeClosingBrace.BreakIndent)
 51 | ERROR | [x] Expected 1 newline at end of file; 0 found
    |       |     (Drupal.Files.EndFileNewline.NoneFound)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...ta-3360082/web/modules/custom/trapadata-3360082/src/Form/TrapadataForm.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
  8 | ERROR | [x] Missing class doc comment
    |       |     (Drupal.Commenting.ClassComment.Missing)
 43 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
    |       |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 44 | ERROR | [x] Expected 2 space(s) before asterisk; 3 found
    |       |     (Drupal.Commenting.DocCommentAlignment.SpaceBeforeStar)
 45 | ERROR | [x] Expected 2 space(s) before asterisk; 3 found
    |       |     (Drupal.Commenting.DocCommentAlignment.SpaceBeforeStar)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Time: 116ms; Memory: 6MB

 
 

šŸ“Œ Task
Status

Needs review

Component

Code

Created by

šŸ‡®šŸ‡³India Shanu Chouhan

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Shanu Chouhan
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • šŸ‡®šŸ‡³India Shanu Chouhan

    Here's a patch for it.

  • Status changed to Needs work about 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.

    The command shown in the issue summary does not use the correct value for --standard.

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Status changed to Needs review about 1 year ago
  • šŸ‡®šŸ‡³India Ashutosh Ahirwal India

    Providing patch with phpcs fixes.

  • Status changed to Needs work about 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    The status is for the issue summary that needs to be updated to show the correct command used to get the report shown in the issue summary. (Hint: phpcs --standard=Drupal/web/modules/contrib/trapadata/ will not produce any report.)

  • Status changed to Needs review about 1 year ago
  • Status changed to Needs work about 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    Please see my previous comment, which explains why the status is Needs work and what needs to be done.

  • Assigned to imustakim
  • šŸ‡®šŸ‡³India imustakim Ahmedabad
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • šŸ‡®šŸ‡³India imustakim Ahmedabad

    Issue summary updated.

  • šŸ‡®šŸ‡³India Yashaswi18

    The patch provided in #7 applies cleanly, ran the phpcs command to verify , no phpcs errors or warnings remaining.

  • Pipeline finished with Success
    3 months ago
    Total: 193s
    #118047
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Pipeline finished with Success
    3 months ago
    Total: 137s
    #118059
  • šŸ‡µšŸ‡­Philippines clarkssquared

    Hi

    I applied MR !1 and there are few remaining PHPCS issues has been reported.

    āžœ  trapadata git:(1.0.x) curl https://git.drupalcode.org/project/trapadata/-/merge_requests/1.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  9553    0  9553    0     0  19321      0 --:--:-- --:--:-- --:--:-- 19696
    patching file .gitlab-ci.yml
    patching file 'src/Form/TrapadataForm.php'
    patching file trapadata.module
    āžœ  trapadata git:(1.0.x) āœ— ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml trapadata 
    
    FILE: ...bing/Projects/d9/d9-local/web/modules/contrib/trapadata/trapadata.info.yml
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     6 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...subing/Projects/d9/d9-local/web/modules/contrib/trapadata/trapadata.module
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     43 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced
        |       |     with use statements
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    Time: 198ms; Memory: 10MB
    
    āžœ  contrib git:(master) āœ— 
  • Pipeline finished with Canceled
    3 months ago
    Total: 41s
    #121362
  • Pipeline finished with Success
    3 months ago
    Total: 136s
    #121363
Production build 0.69.0 2024