Fix the issues reported by phpcs

Created on 4 April 2023, over 1 year ago
Updated 18 July 2024, 4 months ago
šŸ“Œ Task
Status

Needs review

Version

2.0

Component

Code

Created by

šŸ‡®šŸ‡³India urvashi_vora Madhya Pradesh, India

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

Merge Requests

Comments & Activities

  • Issue created by @urvashi_vora
  • Status changed to Needs work over 1 year ago
  • šŸ‡®šŸ‡³India saket-001

    Hi @urvashi_vora patch is good but its not fixes all the standard issues so moving status to Needs Work.
    Sharing the SS .

  • Assigned to akshaydalvi212
  • Issue was unassigned.
  • šŸ‡®šŸ‡³India akshaydalvi212

    providing the #4 patch which eliminates almost all the issues reported by PHPCS.

    only below error are remaining
    FILE: .../news_zymphonies_theme/includes/fontawesome/css/font-awesome.css
    ----------------------------------------------------------------------
    FOUND 5 ERRORS AFFECTING 5 LINES
    ----------------------------------------------------------------------
    121 | ERROR | Style definitions must end with a semicolon
    127 | ERROR | Style definitions must end with a semicolon
    133 | ERROR | Style definitions must end with a semicolon
    139 | ERROR | Style definitions must end with a semicolon
    145 | ERROR | Style definitions must end with a semicolon
    ----------------------------------------------------------------------

    kindly review the patch.

  • šŸ‡®šŸ‡³India Akram Khan Cuttack, Odisha

    checked patch #5 it remove all PHPCS issues

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
    -+function ($) {
    ++ function ($) {
       'use strict';

    Probably the patch is malformed.

    -    var called = false, $el = this
    -    $(this).one($.support.transition.end, function () { called = true })
    -    var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
    +    var called = FALSE, $el = this

    The Drupal coding standards for JavaScript ā†’ says:

    Each variable assignment SHOULD be declared on a separate line - including variables that are only declared but do not get a value assigned.

    +      if (!data) { $this.data('bs.alert', (data = new Alert(this)))
    +      if (typeof option == 'string') { data[option].call($this)
    +    }
    +      }

    The code indentation is not correct.

    -    if (e.isDefaultPrevented()) return
    +    if (e.isDefaultPrevented()) { return

    That code is not formatted as the Drupal coding standards show.

    if (condition1 || condition2) {
      action1();
    }
    else if (condition3 && condition4) {
      action2();
    }
    else {
      defaultAction();
    }
    
  • Assigned to akshaydalvi212
  • šŸ‡®šŸ‡³India akshaydalvi212

    I will work on it and provide updated patch file.

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India akshaydalvi212

    kindly review the patch.
    fixed all the indention issues.

  • šŸ‡®šŸ‡³India Anmol_Specbee

    The patch file 3352113-coding-standard-9.patch didn't apply successfully. Adding a screenshot for reference.

  • Status changed to Needs work over 1 year ago
  • šŸ‡®šŸ‡³India mrinalini9 New Delhi

    Rerolled patch #9, please review it.

    Thanks!

  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
    diff --git a/includes/bootstrap/js/bootstrap.js b/includes/bootstrap/js/bootstrap.js
    index 8ae571b..a5dc5e3 100644
    --- a/includes/bootstrap/js/bootstrap.js
    +++ b/includes/bootstrap/js/bootstrap.js

    The report shown in the issue summary does not show warnings nor errors for the includes/bootstrap/js/bootstrap.js file.

  • Hi, patch #12 applied cleanly but it not fixes all the phpcs issues.

    $ phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml news_zymphonies_theme/
    
    FILE: ...isha\news_zymphonies_theme\config\optional\block.block.news_zymphonies_theme_page_title.yml
    -------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------
     17 | ERROR | [x] Expected 1 newline at end of file; 0 found
    -------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Nisha\news_zymphonies_theme\css\global.css
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------
     1 | WARNING | File appears to be minified and cannot be processed
    ----------------------------------------------------------------------
    
    
    FILE: C:\Users\Nisha\news_zymphonies_theme\css\media.css
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------
     1 | WARNING | File appears to be minified and cannot be processed
    ----------------------------------------------------------------------
    
    
    FILE: C:\Users\Nisha\news_zymphonies_theme\includes\flexslider\css\flexslider.css
    ----------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------
     1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
    ----------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Nisha\news_zymphonies_theme\includes\fontawesome\css\font-awesome.css
    ------------------------------------------------------------------------------------
    FOUND 6 ERRORS AFFECTING 6 LINES
    ------------------------------------------------------------------------------------
       1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
     121 | ERROR | [ ] Style definitions must end with a semicolon
     127 | ERROR | [ ] Style definitions must end with a semicolon
     133 | ERROR | [ ] Style definitions must end with a semicolon
     139 | ERROR | [ ] Style definitions must end with a semicolon
     145 | ERROR | [ ] Style definitions must end with a semicolon
    ------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Nisha\news_zymphonies_theme\includes\owl\assets\owl.carousel.css
    ------------------------------------------------------------------------------------
    FOUND 6 ERRORS AFFECTING 5 LINES
    ------------------------------------------------------------------------------------
       1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
       1 | ERROR | [x] Whitespace found at end of line
      40 | ERROR | [x] Whitespace found at end of line
      51 | ERROR | [x] Whitespace found at end of line
     146 | ERROR | [x] Whitespace found at end of line
     161 | ERROR | [x] Whitespace found at end of line
    ------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Nisha\news_zymphonies_theme\includes\smartmenus\sm-core-css.css
    ------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    ------------------------------------------------------------------------------------
       1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
     179 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    ------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Nisha\news_zymphonies_theme\news_zymphonies_theme.theme
    ------------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    ------------------------------------------------------------------------------------
       1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
     114 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
     115 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
    ------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------
    
    Time: 2.51 secs; Memory: 18MB
    
    
  • šŸ‡®šŸ‡³India Yashaswi18

    bootstrap.js file changes not included in this patch.

  • šŸ‡®šŸ‡³India pray_12

    Hi,
    Reviewed the above patch. Patch applied cleanly, but found few errors and warnings that need to be addressed.

  • Status changed to Needs work 6 months ago
  • šŸ‡®šŸ‡³India dev16.addweb
    FILE: /home/addweb/Drupal8-vagrant/web/web/patches/news_zymphonies_theme/includes/fontawesome/css/font-awesome.css
    ------------------------------------------------------------------------------------------------------------------
    FOUND 5 ERRORS AFFECTING 5 LINES
    ------------------------------------------------------------------------------------------------------------------
     121 | ERROR | Style definitions must end with a semicolon
     127 | ERROR | Style definitions must end with a semicolon
     133 | ERROR | Style definitions must end with a semicolon
     139 | ERROR | Style definitions must end with a semicolon
     145 | ERROR | Style definitions must end with a semicolon
    ------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/addweb/Drupal8-vagrant/web/web/patches/news_zymphonies_theme/css/global.css
    ---------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------
     1 | WARNING | File appears to be minified and cannot be processed
    ---------------------------------------------------------------------------------------
    
    
    FILE: /home/addweb/Drupal8-vagrant/web/web/patches/news_zymphonies_theme/css/media.css
    --------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------------
     1 | WARNING | File appears to be minified and cannot be processed
    --------------------------------------------------------------------------------------
    
    
    FILE: /home/addweb/Drupal8-vagrant/web/web/patches/news_zymphonies_theme/news_zymphonies_theme.info.yml
    -------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------
     1 | WARNING | "core_version_requirement" property is missing in the info.yml file
    -------------------------------------------------------------------------------------------------------
    
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    apaderno ā†’ changed the visibility of the branch 3352113-fix-phpcs-issues to hidden.

  • Pipeline finished with Success
    6 months ago
    Total: 3692s
    #191929
  • Pipeline finished with Success
    6 months ago
    Total: 3692s
    #191932
  • First commit to issue fork.
  • Status changed to Needs review 4 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi,

    Please review MR!7. These are the issues remaining.

    āžœ  contrib phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml news_zymphonies_theme
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/themes/contrib/news_zymphonies_theme/css/global.css
    --------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------
     1 | WARNING | File appears to be minified and cannot be processed
    --------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/themes/contrib/news_zymphonies_theme/css/media.css
    -------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------
     1 | WARNING | File appears to be minified and cannot be processed
    -------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/themes/contrib/news_zymphonies_theme/includes/fontawesome/css/font-awesome.css
    -----------------------------------------------------------------------------------------------------------------------------------
    FOUND 5 ERRORS AFFECTING 5 LINES
    -----------------------------------------------------------------------------------------------------------------------------------
     121 | ERROR | Style definitions must end with a semicolon
     127 | ERROR | Style definitions must end with a semicolon
     133 | ERROR | Style definitions must end with a semicolon
     139 | ERROR | Style definitions must end with a semicolon
     145 | ERROR | Style definitions must end with a semicolon
    -----------------------------------------------------------------------------------------------------------------------------------
    
    Time: 444ms; Memory: 20MB
    
    āžœ  contrib

    Please check and advise.
    Thank you.

  • Pipeline finished with Success
    4 months ago
    Total: 3689s
    #227648
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    apaderno ā†’ changed the visibility of the branch 3352113-gitlab-ci-reports to hidden.

  • Pipeline finished with Success
    4 months ago
    Total: 3683s
    #227924
Production build 0.71.5 2024