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

Comments

Shanu Chouhan created an issue. See original summary.

shanu chouhan’s picture

Assigned: shanu chouhan » Unassigned
Status: Active » Needs review
StatusFileSize
new2.04 KB

Here's a patch for it.

avpaderno’s picture

Title: Drupal coding standards issues » Fix the issues reported by phpcs
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 is not correct.

avpaderno’s picture

The module does not even seem complete. I am not sure it makes sense to fix coding standards.

frob’s picture

I don't know what you mean by "Complete."

ashutosh ahirwal’s picture

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

Providing patch with phpcs fixes.

avpaderno’s picture

Status: Needs review » Needs work

The 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 that phpcs --standard=Drupal/web/modules/contrib/yml_query/ is the wrong command.

Neeraj333’s picture

Status: Needs work » Needs review
StatusFileSize
new3 KB
avpaderno’s picture

Status: Needs review » Needs work

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

frob’s picture

Assigned: Unassigned » frob

I have add a Makefile with a validate target that can be used to validate the php.

  • c30ec283 committed on 1.0.x
    Issue #3359978 by Shanu Chouhan, Neeraj333, Ashutosh Ahirwal, apaderno,...
frob’s picture

Assigned: frob » Unassigned
Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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