Fix the issues reported by phpcs

Created on 10 March 2023, over 1 year ago

Problem/Motivation

FILE: /Users/projects/drupal-d10/modules/contrib/image_style_quality/tests/src/Kernel/ImageStyleQualityTest.php
----------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------
 25 | ERROR | Missing member variable doc comment
 26 | ERROR | Missing member variable doc comment
----------------------------------------------------------------------------------------------------------------------


FILE: /Users/projects/drupal-d10/modules/contrib/image_style_quality/README.txt
---------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------
 25 | WARNING | [ ] Line exceeds 80 characters; contains 136 characters
 35 | ERROR   | [x] Expected 1 newline at end of file; 0 found
---------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------


FILE: /Users/projects/drupal-d10/modules/contrib/image_style_quality/src/Plugin/ImageEffect/ImageStyleQualityImageEffect.php
----------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------
 23 | ERROR | [ ] Missing member variable doc comment
 24 | ERROR | [ ] Missing member variable doc comment
 30 | ERROR | [x] Expected 1 blank line before function; 2 found
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------


FILE: /Users/projects/drupal-d10/modules/contrib/image_style_quality/src/MutableQualityToolkitManager.php
----------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------
 15 | ERROR | Missing member variable doc comment
 16 | ERROR | Missing member variable doc comment
----------------------------------------------------------------------------------------------------------------------
Time: 101ms; Memory: 10MB

Steps to reproduce

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

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

šŸ“Œ Task
Status

Needs work

Version

1.5

Component

Code

Created by

šŸ‡®šŸ‡³India rassoni Bangalore

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 @rassoni
  • First commit to issue fork.
  • Assigned to kunal_sahu
  • šŸ‡®šŸ‡³India kunal_sahu Karnataka
  • šŸ‡®šŸ‡³India kunal_sahu Karnataka

    Hi i could reproduce the issue. Got these coding standard issues .

    kunal@LAPTOP-G4FTKS5H MINGW64 /c/xampp/htdocs/contributions
    $ vendor/bin/phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml web/modules/contrib/image_style_quality-3347132/
    FILE: ...s\contributions\web\modules\contrib\image_style_quality-3347132\README.txt
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    --------------------------------------------------------------------------------
     25 | WARNING | [ ] Line exceeds 80 characters; contains 136 characters
     35 | ERROR   | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...s\contrib\image_style_quality-3347132\src\MutableQualityToolkitManager.php
    --------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    --------------------------------------------------------------------------------
      1 | ERROR | [x] End of line character is invalid; expected "\n" but found
        |       |     "\r\n"
     15 | ERROR | [ ] Missing member variable doc comment
     16 | ERROR | [ ] Missing member variable doc comment
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...\image_style_quality-3347132\src\MutableQualityToolkitManagerInterface.php
    --------------------------------------------------------------------------------
    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: ...le_quality-3347132\src\Plugin\ImageEffect\ImageStyleQualityImageEffect.php
    --------------------------------------------------------------------------------
    FOUND 4 ERRORS AFFECTING 4 LINES
    --------------------------------------------------------------------------------
      1 | ERROR | [x] End of line character is invalid; expected "\n" but found
        |       |     "\r\n"
     23 | ERROR | [ ] Missing member variable doc comment
     24 | ERROR | [ ] Missing member variable doc comment
     30 | ERROR | [x] Expected 1 blank line before function; 2 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...rib\image_style_quality-3347132\tests\src\Kernel\ImageStyleQualityTest.php
    --------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    --------------------------------------------------------------------------------
      1 | ERROR | [x] End of line character is invalid; expected "\n" but found
        |       |     "\r\n"
     25 | ERROR | [ ] Missing member variable doc comment
     26 | ERROR | [ ] Missing member variable doc comment
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    Time: 3.08 secs; Memory: 10MB
    

    Will create an MR to fix these issues.

    Thanks

  • @kunal_sahu opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India kunal_sahu Karnataka
  • šŸ‡®šŸ‡³India nayana_mvr

    Verified the MR!2 on Drupal version 10.1.x. All the coding standard errors mentioned in the ticket are fixed

  • Status changed to Needs work 3 months ago
  • Hi @kunal_sahu,

    Applied the changes you committed on MR!2, it was applied successfully, however there are still few errors reported. Please see below:

    āžœ  image_style_quality git:(main) āœ— curl https://git.drupalcode.org/project/image_style_quality/-/merge_requests/2.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  4275    0  4275    0     0  14507      0 --:--:-- --:--:-- --:--:-- 15159
    patching file README.txt
    patching file src/MutableQualityToolkitManager.php
    patching file src/Plugin/ImageEffect/ImageStyleQualityImageEffect.php
    patching file tests/src/Kernel/ImageStyleQualityTest.php
    āžœ  image_style_quality git:(main) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig image_style_quality
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue/web/modules/contrib/image_style_quality/README.txt
    -------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------
     36 | ERROR | [x] Expected 1 newline at end of file; 0 found
    -------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue/web/modules/contrib/image_style_quality/src/Plugin/ImageEffect/ImageStyleQualityImageEffect.php
    ----------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------------------------------------
     8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
    ----------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 182ms; Memory: 10MB

    Kindly check

    Thanks,
    Jake

  • Status changed to Closed: duplicate 15 days ago
  • heddn Nicaragua

    This got fixed when šŸ“Œ Gitlab CI yml Active got merged.

Production build 0.71.5 2024