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

 
 

Issue fork trapadata-3360082

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Shanu Chouhan created an issue. See original summary.

shanu chouhan’s picture

Assigned: shanu chouhan » Unassigned
Status: Active » Needs review
StatusFileSize
new588 bytes

Here's a patch for it.

avpaderno’s picture

Priority: Normal » Minor
Status: Needs review » Needs work
Issue tags: +Coding standards, +Needs issue summary update

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.

avpaderno’s picture

Title: Drupal coding standards issues » Fix the issues reported by phpcs
ashutosh ahirwal’s picture

Status: Needs work » Needs review
StatusFileSize
new2.75 KB

Providing patch with phpcs fixes.

avpaderno’s picture

Status: Needs review » Needs work

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

Neeraj333’s picture

Status: Needs work » Needs review
StatusFileSize
new2.12 KB
avpaderno’s picture

Status: Needs review » Needs work

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

imustakim’s picture

Assigned: Unassigned » imustakim
imustakim’s picture

Assigned: imustakim » Unassigned
Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs issue summary update

Issue summary updated.

yashaswi18’s picture

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

avpaderno’s picture

Issue summary: View changes
avpaderno’s picture

Issue summary: View changes
clarkssquared’s picture

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) ✗