Fix the issues reported by phpcs

Created on 7 June 2023, over 1 year ago
Updated 11 July 2024, 5 months ago
📌 Task
Status

RTBC

Version

1.0

Component

Code

Created by

🇮🇳India arti_parmar

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.

  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

Sign in to follow issues

Merge Requests

Comments & Activities

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

    Kindly review patch

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

    Hi arti_parmar

    I applied your patch and there are still some warnings and errors

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

    FILE: /Users/studenttrainees/Project10/drupalorg10/docroot/themes/contrib/generation_theme/generation_theme.info.yml
    --------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------
    8 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------

    FILE: /Users/studenttrainees/Project10/drupalorg10/docroot/themes/contrib/generation_theme/css/content_three.css
    ----------------------------------------------------------------------------------------------------------------
    FOUND 5 ERRORS AFFECTING 5 LINES
    ----------------------------------------------------------------------------------------------------------------
    171 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    172 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
    173 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    176 | ERROR | [ ] More than 2 empty lines are not allowed
    177 | ERROR | [x] Expected 1 newline at end of file; 0 found
    ----------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------

    FILE: /Users/studenttrainees/Project10/drupalorg10/docroot/themes/contrib/generation_theme/generation_theme.theme
    -----------------------------------------------------------------------------------------------------------------
    FOUND 80 ERRORS AFFECTING 71 LINES
    -----------------------------------------------------------------------------------------------------------------
    1 | ERROR | [x] Missing file doc comment
    3 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
    5 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
    6 | ERROR | [x] Expected 3 space(s) before asterisk; 2 found
    7 | ERROR | [x] Expected 3 space(s) before asterisk; 2 found
    8 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
    9 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
    11 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    12 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    13 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    14 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
    15 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    15 | ERROR | [x] Whitespace found at end of line
    16 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    17 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
    18 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    20 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    21 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    22 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
    23 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    23 | ERROR | [x] Whitespace found at end of line
    24 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    25 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
    26 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    28 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    29 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    30 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
    31 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    31 | ERROR | [x] Whitespace found at end of line
    32 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    33 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
    34 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    36 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    37 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    38 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    39 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
    40 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
    41 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 10
    42 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 10
    43 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 12
    44 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 12
    45 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 12
    46 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 10
    47 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
    48 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    48 | ERROR | [x] Whitespace found at end of line
    50 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    51 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    52 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
    53 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    53 | ERROR | [x] Whitespace found at end of line
    54 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    55 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
    56 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    58 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
    59 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
    61 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
    65 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
    67 | ERROR | [x] There must be no blank lines after the function comment
    69 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
    69 | ERROR | [x] Expected 1 space before opening brace; found 0
    70 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    75 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    80 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    86 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    92 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    98 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    105 | ERROR | [x] Whitespace found at end of line
    106 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    112 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
    112 | ERROR | [x] Expected 1 blank line after function; 2 found
    115 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
    115 | ERROR | [x] Missing function doc comment
    116 | ERROR | [x] Whitespace found at end of line
    117 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    118 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
    119 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
    120 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    121 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 3
    121 | ERROR | [x] Closing brace indented incorrectly; expected 2 spaces, found 3
    -----------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 80 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------

    Time: 326ms; Memory: 10MB

  • Status changed to Needs review over 1 year ago
  • Status changed to RTBC over 1 year ago
  • 🇮🇳India arpitk

    Hi i reviewed the patch #4. The patch applies cleanly no phpcs warnings/errors are produced. I ran phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,js .

    moving it to RTBC

    Thanks!

  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    +/**
    + * @file
    + * Theme file to alter drupal functionality and add new feature.
    + */

    The usual description for a .theme file is Functions to support theming in the [theme name] theme.

    +function generation_theme_preprocess_page(&$variables) {
    +
    +  // Get subheading.
    +  $mainheading = theme_get_setting('mainheading');

    Drupal coding standards do not say that an empty line must be placed between a function declaration and its first code line.
    That comment is not necessary, since what the code does is clear by itself; it is also wrong, as that is the main heading, not a sub-heading.

    +/**
    + * @file
    + * Theme settings in this file.
    + */
    +
    +/**
    + * Implements hook_form_system_theme_settings_alter().
    + */

    @file is only added at the top of the file, once.

    I guess the issue summary must be updated, since the report is only for two files, while the patch changes 10 files.

  • Assigned to nitin_lama
  • Hello Everyone !!
    Created a patch for Generation Theme 1.0.x-dev . Updated the changes addressed in #6
    .The patch successfully worked for me on drupal version 9.5.9 and php 8.2.
    Can someone please review the patch.

    Thank you for your support!!!

  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work over 1 year ago
  • 🇮🇳India nitin_lama India

    Hi @thakurnishant_06. I think you are new here. Please assign the issue to yourself first before working on it. You need to provide interdiff with the patch as well so that other developers can see your changes. Also your patch doesn't fix all the issue addressed in #6.
    Please follow the Drupal contributor guide
    Also requesting to follow issue etiquette .
    Thanks.

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    +/**
    + * @file
    + * Functions to support theming in the Generation Theme.
    + */
    

    It is Functions to support theming in the Generation Theme theme.

  • Assigned to nitin_lama
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India nitin_lama India

    Addressed #14. Updated patch.

  • Issue was unassigned.
  • HI, reviewed the patch at #16, applies cleanly and addresses the comment #14 , but found minor error.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇳India dev16.addweb

    Hi, I have fix error mention in #18 and updated patch.

  • Status changed to RTBC 5 months ago
  • Hi @everyone,

    Applied @silvi.addweb's patch successfully, confirmed it fixed reported issues.

    generation_theme git:(1.0.x) curl https://www.drupal.org/files/issues/2024-06-27/phpcs-issue-fixes-3365300-20.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 43235  100 43235    0     0  91927      0 --:--:-- --:--:-- --:--:-- 94193
    patching file css/banner.css
    patching file css/content_three.css
    patching file css/footer.css
    patching file css/generation_about.css
    patching file css/generation_feature.css
    patching file css/navbar.css
    patching file generation_theme.info.yml
    patching file generation_theme.libraries.yml
    patching file generation_theme.theme
    patching file templates/comment/comment--comment--article.html.twig
    ➜  generation_theme git:(1.0.x) ✗ cd ..
    ➜  contrib git:(master) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig generation_theme
    ➜  contrib git:(master) ✗

    Will now move this to RTBC

    Thanks,
    Jake

  • Status changed to Needs work 5 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    Let's create a MR, now that patched are no longer tested.

  • Pipeline finished with Success
    5 months ago
    Total: 142s
    #221662
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • First commit to issue fork.
  • Status changed to Needs review 5 months ago
  • 🇮🇳India bhaveshdas

    I have fixed all phpcs Issues could you please review it.

    Thankyou !

  • Status changed to RTBC 5 months ago
  • 🇮🇳India amanbtr72

    Reviewed the MR and found some errors by PHPCBF resolve it automatically, so nothing to do with it. All good.

    Moving to RTBC.

    Thanks

  • Pipeline finished with Success
    5 months ago
    Total: 5889s
    #221716
Production build 0.71.5 2024