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
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | fix_coding_standard-3360082-7.patch | 2.12 KB | Neeraj333 |
| #5 | phpcs-issue-fixes-3360082-5.patch | 2.75 KB | ashutosh ahirwal |
| #2 | 3360082-2.patch | 588 bytes | shanu chouhan |
Issue fork trapadata-3360082
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
Comment #2
shanu chouhan commentedHere's a patch for it.
Comment #3
avpadernoThe 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.Comment #4
avpadernoComment #5
ashutosh ahirwal commentedProviding patch with phpcs fixes.
Comment #6
avpadernoThe 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.)Comment #7
Neeraj333 commentedComment #8
avpadernoPlease see my previous comment, which explains why the status is Needs work and what needs to be done.
Comment #9
imustakim commentedComment #10
imustakim commentedIssue summary updated.
Comment #11
yashaswi18 commentedThe patch provided in #7 applies cleanly, ran the phpcs command to verify , no phpcs errors or warnings remaining.
Comment #13
avpadernoComment #14
avpadernoComment #15
clarkssquared commentedHi
I applied MR !1 and there are few remaining PHPCS issues has been reported.