Fix the issues reported by phpcs

Created on 2 June 2023, over 1 year ago
Updated 6 June 2023, over 1 year ago

Running shows the following errors/warnings that should be fixed.

FILE: ./pachu/css/custom.css
---------------------------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 9 LINES
---------------------------------------------------------------------------------------
 3150 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
 3151 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
 3180 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
 3863 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
 3864 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
 3865 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 3865 | ERROR | [x] Blank lines are not allowed in class definitions
 3865 | ERROR | [x] Whitespace found at end of line
 3867 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
 3868 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 3868 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
 4979 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
---------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------


FILE: ./pachu/templates/system/menu--main.html.twig
-------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------
 65 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------


FILE: ./pachu/templates/system/html.html.twig
-------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------
 58 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------


FILE: ./pachu/templates/system/page--403.html.twig
------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------
 27 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------


FILE: ./pachu/templates/system/page.html.twig
-------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------
 40 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------


FILE: ./pachu/templates/content/comment.html.twig
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 105 | ERROR | [x] Expected 1 newline at end of file; 4 found
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ./pachu/templates/content/commerce-product.html.twig
--------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------
 41 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------


FILE: ./pachu/templates/form/select.html.twig
-------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------
 26 | ERROR | [x] Expected 1 newline at end of file; 2 found
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------


FILE: ./pachu/templates/field/image.html.twig
-------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------
 19 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------

Time: 1.14 secs; Memory: 80.01MB
๐Ÿ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

๐Ÿ‡ต๐Ÿ‡ญPhilippines paraderojether

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 @paraderojether
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines paraderojether

    Created a patch to fix the issues reported by phpcs.

    Please review.
    Thank You.

  • Hello everyone,
    Tested the #2 patch for pachu 1.0.x-dev on Drupal 9.5.9 and PHP 8.2.4, the issue has been successfully fixed for me. Attached before and after screenshots for references.

    Thank you for your support!!!

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    The reported errors/warnings are more than the ones shown in the issue summary.

  • Assigned to nitin_lama
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India

    True @apaderno . Updated patch.

    Only warning left:

  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    That warning just says phpcs cannot show errors/warnings for minified files. It does not require any change in the project files.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
    +;/*!
      * jQuery Cycle Plugin (with Transition Definitions)
      * Examples and documentation at: http://jquery.malsup.com/cycle/
      * Copyright (c) 2007-2013 M. Alsup
    @@ -6,26 +6,26 @@
      * Dual licensed under the MIT and GPL licenses.
      * http://jquery.malsup.com/license.html
      * Requires: jQuery v1.7.1 or later
    - */
    -;(function($, undefined) {
    + */(function ($, undefined) {

    It is not necessary to move the semicolon before the comment; it needs to be simple be removed.
    A closure is placed on its own line, not on the line containing a comment delimiter.

    function debug(s) {
    -	if ($.fn.cycle.debug)
    -		log(s);
    -}		
    +    if ($.fn.cycle.debug) {
    +        log(s);
    +    }
    +}

    Those lines are still not correctly indented, since Drupal uses two spaces also for the indentation of JavaScript files.

    +    /*global console */
    +    if (window.console && console.log) {
    +        console.log('[cycle] ' + Array.prototype.join.call(arguments,' '));
    +    }

    I would rather remove that comment (which is still not correctly formatted), since there is no need to explain what window.console is accessing.

    I would also avoid changing the jquery.cycle.all.js file, since that is a file copied from another repository. It does not make sense to change that file all the time it is updated. (The fact projects hosted on drupal.org should avoid including files hosted somewhere else is a different matter, considering there are exceptions to that.)
    The same holds true for other files that have been copied from other repositories.

  • Assigned to nitin_lama
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India

    Addressed #9.

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • Hello nitin_lama
    Tested your #11 patch and implemented on my website having Drupal 9.5.9 and PHP 8.2. I will be adding screenshot (after patch) for reference.
    Thank you for your support!!

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Ridhima gupta Jaipur , Rajasthan

    Ridhima gupta โ†’ made their first commit to this issueโ€™s fork.

Production build 0.71.5 2024