Problem/Motivation
Module's code contains several Drupal Coding Standards issues. This task is created to fix them.
Steps to reproduce
Run the command:
phpcs --standard=Drupal/web/modules/contrib/yml_query/
Proposed resolution
Fix the following coding standards issues and upload the patch or create an MR with fixes.
FILE: \modules\contrib\yml_query\src\Parser.php
---------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 2 WARNINGS AFFECTING 7 LINES
---------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
9 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
46 | ERROR | [x] Expected 1 space before opening brace; found 0
46 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
50 | ERROR | [ ] Missing short description in doc comment
91 | ERROR | [x] Expected 1 space before opening brace; found 2
91 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
93 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
98 | WARNING | [x] There must be no blank line following an inline comment
---------------------------------------------------------------------------------------------------------------------
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | fix_coding_standard-3359978-8.patch | 3 KB | Neeraj333 |
| #6 | phpcs-issue-fixes-3359978-6.patch | 2.8 KB | ashutosh ahirwal |
| #2 | 3359978-2.patch | 2.04 KB | shanu chouhan |
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 is not correct.
Comment #4
avpadernoThe module does not even seem complete. I am not sure it makes sense to fix coding standards.
Comment #5
frobI don't know what you mean by "Complete."
Comment #6
ashutosh ahirwal commentedProviding patch with phpcs fixes.
Comment #7
avpadernoThe status is for the issue summary that still needs to be updated as per my previous comment.
It is sufficient to run
phpcs --standard=Drupal/web/modules/contrib/yml_query/and see which error message is returned, to understand thatphpcs --standard=Drupal/web/modules/contrib/yml_query/is the wrong command.Comment #8
Neeraj333 commentedComment #9
avpadernoSee my previous comment, which explains why the status is Needs work and what needs to be done.
Comment #10
frobI have add a Makefile with a validate target that can be used to validate the php.
Comment #12
frob