Fix phpcs errors and warnings

Created on 9 June 2023, over 1 year ago
Updated 30 June 2023, over 1 year ago

Problem/Motivation

Phpcs is pointing some errors and warnings on this theme.

Steps to reproduce

Run the command :

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

Proposed resolution

FILE: D:\xampp\htdocs\drupal_10\web\themes\contrib\particles_orange\assets\css\canvas.css
-----------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------
1 | ERROR | [x] Additional whitespace found at start of file
-----------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\drupal_10\web\themes\contrib\particles_orange\assets\css\style.css
----------------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 8 LINES
----------------------------------------------------------------------------------------
166 | ERROR | Class definition is empty
606 | ERROR | Class definition is empty
1124 | ERROR | Style definitions must end with a semicolon
1160 | ERROR | Style definitions must end with a semicolon
1570 | ERROR | Class definition is empty
2063 | ERROR | Style definitions must end with a semicolon
2264 | ERROR | Style definitions must end with a semicolon
2271 | ERROR | Style definitions must end with a semicolon
----------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\drupal_10\web\themes\contrib\particles_orange\assets\fontawesome\css\font-awesome.css
-----------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
-----------------------------------------------------------------------------------------------------------
127 | ERROR | Style definitions must end with a semicolon
135 | ERROR | Style definitions must end with a semicolon
143 | ERROR | Style definitions must end with a semicolon
151 | ERROR | Style definitions must end with a semicolon
159 | ERROR | Style definitions must end with a semicolon
-----------------------------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\drupal_10\web\themes\contrib\particles_orange\particles_orange.theme
------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------
23 | ERROR | Doc comment is empty
63 | ERROR | Doc comment is empty
------------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\drupal_10\web\themes\contrib\particles_orange\README.txt
------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------
52 | WARNING | Line exceeds 80 characters; contains 101 characters
------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\drupal_10\web\themes\contrib\particles_orange\theme-settings.php
--------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------------
134 | WARNING | Do not pass empty strings to t()
151 | ERROR | Doc comment is empty
--------------------------------------------------------------------------------------

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India arti_parmar

Live updates comments and jobs are added and updated live.
Sign in to follow issues

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
  • 🇮🇳India Raveen Kumar

    @Arti, please look at the screenshot attached. My phpcs error log is very much different from yours.
    Also when I applied your patch it doesn't work. I have applied the patch through composer. The patch is failing.
    Please re-look into it. And Thank you.

  • Assigned to Akshay kashyap
  • 🇮🇳India Akshay kashyap

    @arti_parmar

    Thanks for the work

    I am not able to apply the patch successfully

    git apply -v 3365822-2.patch
    Checking patch README.txt...
    Checking patch assets/css/bootstrap.min.css...
    Checking patch assets/css/canvas.css...
    Checking patch assets/css/style.css...
    error: while searching for:
    menu,
    nav,
    section {
    	display: block;
    }
    body {
    	line-height: 1.5em;
    }
    ol,
    ul {
    	list-style: none;
    }
    
    .contextual-region ol {
    	list-style: none;
    	display: flex;
    	margin: 0;
    }
    .contextual-region ol li a{
    	padding: 0 15px;
    	position: relative;
    }
    .contextual-region ol li:first-child a{
    	padding-left: 0;
    }
    .contextual-region ol li:last-child a:before{
    	display: none;
    }
    .contextual-region ol li a:before{
    	content: "";
    	border: solid red;
    	border-width: 0 1px 1px 0;
    	display: inline-block;
    	transform: rotate(-45deg);
      	-webkit-transform: rotate(-45deg);
    	padding: 3px;	
    	position: absolute;
    	right: 0;
    	top: 4px;												
    }
    blockquote,
    q {
    	quotes: none;
    }
    blockquote:before,
    blockquote:after,
    q:before,
    q:after {
    	content: '';
    	content: none;
    }
    table {
    	border-collapse: collapse;
    	border-spacing: 0;
    }
    /* Body & Main
    ================================================== */
    
    body {
    	nowhitespace: afterproperty;
    	-webkit-font-smoothing: antialiased;
    	-webkit-text-size-adjust: 100%;
    	color: #606060;
    	word-break: break-word;
    }
    /* Links */
    a:visited {
    	color: #f4473a;
    }
    a:hover,
    a:focus,
    a:active {
    	color: #000;
    	text-decoration: none;
    }
    /*set max img width*/
    
    img {
    	max-width: 100%;
    	height: auto;
    }
    /* Commons
    ================================================== */
    
    
    /* site-banner */
    .ban-hide{
    	padding-top: 102px;
    }
    .site-banner .img-bann{
    	width: 100%;
    	height: 100vh;
    }
    .site-banner{
    	text-align: center;
      overflow: hidden;
      position: relative;
    }
    .slicknav_nav{
    	display: none;
    }
    
    .site-banner:before, .site-banner:after {
      display: block;
      content: " ";
      width: 2560px;
    
    error: patch failed: assets/css/style.css:100
    error: assets/css/style.css: patch does not apply
    Checking patch assets/fontawesome/css/font-awesome.css...
    error: while searching for:
      transform: scale(-1, 1);
    }
    .fa-flip-vertical {
      -webkit-transform: scale(1, -1);
      -moz-transform: scale(1, -1);
      -ms-transform: scale(1, -1);
    
    error: patch failed: assets/fontawesome/css/font-awesome.css:156
    error: assets/fontawesome/css/font-awesome.css: patch does not apply
    Checking patch assets/fontawesome/css/font-awesome.min.css...
    Checking patch particles_orange.info.yml...
    Checking patch particles_orange.libraries.yml...
    Checking patch particles_orange.theme...
    Checking patch theme-settings.php...
    error: while searching for:
        '#type' => 'fieldset',
        '#title' => t('Show Scroll to top arrow'),
      ];
      //show scroller or no
      $form['particles_orange_settings']['show_scroller']['display_scroller'] = [
        '#type' => 'checkbox',
        '#title' => t('Show scroller'),
    
    error: patch failed: theme-settings.php:133
    error: theme-settings.php: patch does not apply
    
  • 🇮🇳India Akshay kashyap

    Created a Patch to fix the PHPCS drupal coding standard issue. Please review it.

  • @akshay-kashyap opened merge request.
  • Status changed to Needs review over 1 year ago
  • Status changed to Fixed over 1 year ago
  • 🇮🇳India Harshita mehra

    @all Thanks for your contribution.

  • Status changed to Fixed over 1 year ago
Production build 0.71.5 2024