Fix minor phpcs issues

Created on 10 July 2024, 5 months ago
Updated 12 July 2024, 5 months ago

Problem/Motivation

Need to fix below phpcs issues

web/modules/custom/simple_carousel/

FILE: /web/modules/custom/simple_carousel/css/simple-carousel.css
---------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------
 152 | ERROR | Class definition is empty
---------------------------------------------------------------------------------------------------------------------------


FILE: /web/modules/custom/simple_carousel/src/Plugin/views/style/SimpleCarousel.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------
 96 | WARNING | Unused variable $row_index.
---------------------------------------------------------------------------------------------------------------------------------------------


FILE: /web/modules/custom/simple_carousel/simple_carousel.module
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
 3 | ERROR | Missing short description in doc comment
--------------------------------------------------------------------------------------------------------------------------

Time: 83ms; Memory: 10MB
šŸ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India dev2.addweb

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 @dev2.addweb
  • Merge request !2#3460454 fixed phpcs issues ā†’ (Open) created by Unnamed author
  • Issue was unassigned.
  • Status changed to Needs review 5 months ago
  • šŸ‡®šŸ‡³India dev2.addweb

    Hi I have fixed phpcs issues and created MR. Please review it.

  • Status changed to Needs work 5 months ago
  • šŸ‡®šŸ‡³India bhaveshdas

    I applied MR!2 and I still encountered some issues after I ran vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig modules/custom/simple_carousel-3460454/

    FILE: /var/www/html/drupal-contri-d10/modules/custom/simple_carousel-3460454/README.txt
    ---------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 8 WARNINGS AFFECTING 9 LINES
    ---------------------------------------------------------------------------------------
      5 | WARNING | [ ] Line exceeds 80 characters; contains 417 characters
      9 | WARNING | [ ] Line exceeds 80 characters; contains 85 characters
     10 | WARNING | [ ] Line exceeds 80 characters; contains 89 characters
     11 | WARNING | [ ] Line exceeds 80 characters; contains 112 characters
     12 | WARNING | [ ] Line exceeds 80 characters; contains 103 characters
     13 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
     17 | WARNING | [ ] Line exceeds 80 characters; contains 236 characters
     24 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
     43 | ERROR   | [x] Expected 1 newline at end of file; 2 found
    ---------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------
    
    
    FILE: /var/www/html/drupal-contri-d10/modules/custom/simple_carousel-3460454/js/simple-carousel.js
    --------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    --------------------------------------------------------------------------------------------------
     28 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
     41 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
    --------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------
    
    Time: 104ms; Memory: 10MB
    
  • Status changed to Needs review 5 months ago
  • šŸ‡®šŸ‡³India dev2.addweb

    Hi,
    I have fixed the error mentioned for the JavaScript file and committed the code.
    Regarding the README.txt file, I have created an issue for this. It will be fixed in issue #3460485. šŸ“Œ Replace README.txt to Readme.md file RTBC

  • Status changed to Needs work 5 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @nilesh.addweb,

    I applied MR!2 and it was applied smoothly. It also fixed the issue with the js file.

    After I ran phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml, these are the issues remaining.

    āžœ  simple_carousel git:(main) āœ— curl https://git.drupalcode.org/project/simple_carousel/-/merge_requests/2.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  3458    0  3458    0     0   1032      0 --:--:--  0:00:03 --:--:--  1032
    patching file css/simple-carousel.css
    patching file js/simple-carousel.js
    patching file simple_carousel.module
    patching file src/Plugin/views/style/SimpleCarousel.php
    āžœ  simple_carousel git:(main) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml simple_carousel
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/simple_carousel/simple_carousel.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
    -------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/simple_carousel/README.txt
    -----------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 8 WARNINGS AFFECTING 9 LINES
    -----------------------------------------------------------------------------------------------
      5 | WARNING | [ ] Line exceeds 80 characters; contains 417 characters
      9 | WARNING | [ ] Line exceeds 80 characters; contains 85 characters
     10 | WARNING | [ ] Line exceeds 80 characters; contains 89 characters
     11 | WARNING | [ ] Line exceeds 80 characters; contains 112 characters
     12 | WARNING | [ ] Line exceeds 80 characters; contains 103 characters
     13 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
     17 | WARNING | [ ] Line exceeds 80 characters; contains 236 characters
     24 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
     43 | ERROR   | [x] Expected 1 newline at end of file; 2 found
    -----------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------
    
    Time: 126ms; Memory: 10MB
    
    āžœ  contrib git:(main) āœ—

    Please check and advise.
    Thank you.

  • Status changed to Needs review 5 months ago
  • šŸ‡®šŸ‡³India dev2.addweb

    Hi @cleavinjosh,

    Thanks for reviewing the MR.

    Please refer to #5, where I mentioned that I've created a new issue for the README.txt file. This will be fixed in issue # 3460485 šŸ“Œ Replace README.txt to Readme.md file RTBC .

    Additionally, instead of installing the module through Composer, please install it by using git clone to avoid the info file issue.

  • Status changed to RTBC 5 months ago
  • šŸ‡®šŸ‡³India dev16.addweb

    Hi,

    I have tested the MR, and there are no errors except for the README.txt file. This will be fixed in the related issue #3460485 šŸ“Œ Replace README.txt to Readme.md file RTBC . Therefore, I am moving this to RTBC

Production build 0.71.5 2024