Fix the issues reported by phpcs

Created on 19 May 2023, over 1 year ago
Updated 20 May 2023, over 1 year ago

Running phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig shows the following errors/warnings that should be fixed.

FILE: ./published_referenced_entity_master/published_referenced_entity.module
  1 | ERROR | [x] Missing file doc comment
 11 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 11 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
 12 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 12 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
 13 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 13 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 2
 14 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 14 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 2
 15 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 15 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 2
 16 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 16 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 2
 17 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 17 | ERROR | [x] Case breaking statement indented incorrectly; expected 4 spaces, found 2
 18 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 18 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
 19 | ERROR | [x] Expected 1 newline at end of file; 2 found

FILE: ./published_referenced_entity_master/src/Plugin/Field/FieldFormatter/PublishedRenderedEntityFormatter.php
  15 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
  64 | ERROR   | [ ] The @var tag must be the first tag in a member variable comment
 167 | ERROR   | [x] Line indented incorrectly; expected 10 spaces, found 8
 168 | ERROR   | [x] Case breaking statement indented incorrectly; expected 10 spaces, found 8
 172 | ERROR   | [x] Line indented incorrectly; expected 10 spaces, found 8
 173 | ERROR   | [x] Case breaking statement indented incorrectly; expected 10 spaces, found 8
 176 | ERROR   | [x] Line indented incorrectly; expected 10 spaces, found 8
 176 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 177 | ERROR   | [x] Case breaking statement indented incorrectly; expected 10 spaces, found 8
 179 | ERROR   | [x] Expected 1 space after IF keyword; 0 found

FILE: ./published_referenced_entity_master/src/Plugin/Field/FieldFormatter/PublishedEntityIdFormatter.php
 33 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 8
 34 | ERROR | [x] Case breaking statement indented incorrectly; expected 10 spaces, found 8
 38 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 8
 39 | ERROR | [x] Case breaking statement indented incorrectly; expected 10 spaces, found 8
 42 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 8
 42 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 43 | ERROR | [x] Case breaking statement indented incorrectly; expected 10 spaces, found 8

FILE: ./published_referenced_entity_master/src/Plugin/Field/FieldFormatter/PublishedEntityLabelFormatter.php
  68 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 8
  69 | ERROR | [x] Case breaking statement indented incorrectly; expected 10 spaces, found 8
  73 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 8
  74 | ERROR | [x] Case breaking statement indented incorrectly; expected 10 spaces, found 8
  77 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 8
  77 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  78 | ERROR | [x] Case breaking statement indented incorrectly; expected 10 spaces, found 8
  83 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
  84 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
  90 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 10
  91 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 10
  92 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 10
  93 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 10
 109 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 10
 110 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 10

FILE: ./published_referenced_entity_master/published_referenced_entity.info.yml
 7 | ERROR | [x] Expected 1 newline at end of file; 0 found
📌 Task
Status

Needs review

Version

1.1

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

Comments & Activities

  • Issue created by @Shanu Chouhan
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India Shanu Chouhan

    Here's a patch for it.

  • Status changed to Needs work over 1 year ago
  • 🇵🇭Philippines kenyoOwen

    Hi Shanu Chouhan

    After applying the patch it still found errors

    vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml published_referenced_entity

    FILE: /Users/studenttrainees/Project10/drupalorg10/docroot/modules/contrib/published_referenced_entity/published_referenced_entity.module
    -----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 18 ERRORS AFFECTING 10 LINES
    -----------------------------------------------------------------------------------------------------------------------------------------
    1 | ERROR | [x] Missing file doc comment
    11 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
    11 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
    12 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
    12 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
    13 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
    13 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 2
    14 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
    14 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 2
    15 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
    15 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 2
    16 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
    16 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 2
    17 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
    17 | ERROR | [x] Case breaking statement indented incorrectly; expected 4 spaces, found 2
    18 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
    18 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
    19 | ERROR | [x] Expected 1 newline at end of file; 2 found
    -----------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 18 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------------------

    FILE: /Users/studenttrainees/Project10/drupalorg10/docroot/modules/contrib/published_referenced_entity/published_referenced_entity.info.yml
    -------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------------
    1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
    1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
    1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
    -------------------------------------------------------------------------------------------------------------------------------------------

    Time: 197ms; Memory: 10MB

  • Assigned to dineshkumarbollu
  • 🇮🇳India dineshkumarbollu

    Hi

    I will work on remaining,

  • @dineshkumarbollu opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India dineshkumarbollu

    Hi

    I created MR for the remaining issues

    Please Review,

  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    If the report shown in the issue summary does not show all the warnings/errors reported by phpcs, the report in the issue summary must be updated. That is helpful to verify the patch/MR fixes all the warnings/errors.

  • Status changed to Needs review over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
Production build 0.71.5 2024