Fix the errors/warnings reported by PHP_CodeSniffer

Created on 8 April 2024, 3 months ago
Updated 30 May 2024, 25 days ago

Problem/Motivation

When running the theme code against Drupal coding standards based on Drupal standard, the theme shows errors

Steps to reproduce

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,yml modules/contrib/school_theme/

Report:

FILE: /app/web/themes/contrib/school_theme/school.theme
----------------------------------------------------------------------
FOUND 111 ERRORS AFFECTING 84 LINES
----------------------------------------------------------------------
   1 | ERROR | [x] Missing file doc comment
   1 | ERROR | [x] The PHP open tag must be followed by exactly one
     |       |     blank line
  12 | ERROR | [x] Use statements should be sorted alphabetically.
     |       |     The first wrong one is
     |       |     Drupal\Component\Utility\SafeMarkup.
  21 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 3
  22 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 3
  24 | ERROR | [x] Namespaced classes/interfaces/traits should be
     |       |     referenced with use statements
  24 | ERROR | [x] Comments may not appear after statements
  29 | ERROR | [x] Closing brace indented incorrectly; expected 3
     |       |     spaces, found 2
  30 | ERROR | [x] Spaces must be used to indent lines; tabs are not
     |       |     allowed
  30 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 1
  30 | ERROR | [x] Expected 1 space after IF keyword; 0 found
  31 | ERROR | [x] Spaces must be used to indent lines; tabs are not
     |       |     allowed
  31 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
     |       |     found 2
  32 | ERROR | [x] Spaces must be used to indent lines; tabs are not
     |       |     allowed
  32 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
     |       |     found 2
  33 | ERROR | [x] Spaces must be used to indent lines; tabs are not
     |       |     allowed
  33 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
     |       |     found 2
  34 | ERROR | [x] Spaces must be used to indent lines; tabs are not
     |       |     allowed
  34 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
     |       |     found 2
  35 | ERROR | [x] Spaces must be used to indent lines; tabs are not
     |       |     allowed
  35 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
     |       |     found 2
  36 | ERROR | [x] Spaces must be used to indent lines; tabs are not
     |       |     allowed
  36 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 1
  37 | ERROR | [x] Spaces must be used to indent lines; tabs are not
     |       |     allowed
  37 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 1
  37 | ERROR | [x] Expected 1 space after IF keyword; 0 found
  38 | ERROR | [x] Spaces must be used to indent lines; tabs are not
     |       |     allowed
  38 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
     |       |     found 2
  39 | ERROR | [x] Spaces must be used to indent lines; tabs are not
     |       |     allowed
  39 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
     |       |     found 2
  40 | ERROR | [x] Spaces must be used to indent lines; tabs are not
     |       |     allowed
  40 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 1
  41 | ERROR | [x] Inline comments must end in full-stops,
     |       |     exclamation marks, question marks, colons, or
     |       |     closing parentheses
  44 | ERROR | [x] Short array syntax must be used to define arrays
  57 | ERROR | [x] Short array syntax must be used to define arrays
  71 | ERROR | [ ] Missing parameter type
  73 | ERROR | [ ] Missing parameter type
  83 | ERROR | [ ] Inline doc block comments are not allowed; use "/*
     |       |     Comment */" or "// Comment" instead
  88 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
  89 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
  90 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
  91 | ERROR | [x] Array closing indentation error, expected 0 spaces
     |       |     but found 2
  92 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
  93 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
  94 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
  95 | ERROR | [x] Array closing indentation error, expected 0 spaces
     |       |     but found 2
  97 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
  98 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
  99 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
 100 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
 101 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
 102 | ERROR | [x] Array closing indentation error, expected 0 spaces
     |       |     but found 2
 104 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
 105 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
 106 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
 107 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
 108 | ERROR | [x] Array closing indentation error, expected 0 spaces
     |       |     but found 2
 109 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
 110 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
 111 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
 112 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
 113 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
 114 | ERROR | [x] Array closing indentation error, expected 0 spaces
     |       |     but found 2
 116 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
 117 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
 122 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
 129 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
 130 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
 135 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
 142 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
 143 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
 148 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
 155 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
 156 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
 161 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
 167 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
 167 | ERROR | [x] Inline comments must start with a capital letter
 167 | ERROR | [x] Inline comments must end in full-stops,
     |       |     exclamation marks, question marks, colons, or
     |       |     closing parentheses
 168 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
     |       |     found 0
 168 | ERROR | [x] Short array syntax must be used to define arrays
 169 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
 170 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
 171 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
 172 | ERROR | [x] Array indentation error, expected 2 spaces but
     |       |     found 4
 173 | ERROR | [x] Array closing indentation error, expected 0 spaces
     |       |     but found 2
 174 | ERROR | [x] Short array syntax must be used to define arrays
 180 | ERROR | [x] Short array syntax must be used to define arrays
 185 | ERROR | [x] Short array syntax must be used to define arrays
 187 | ERROR | [ ] Concatenating translatable strings is not allowed,
     |       |     use placeholders instead and only one string
     |       |     literal
 187 | ERROR | [x] Concat operator must be surrounded by a single
     |       |     space
 191 | ERROR | [x] Short array syntax must be used to define arrays
 193 | ERROR | [ ] Concatenating translatable strings is not allowed,
     |       |     use placeholders instead and only one string
     |       |     literal
 193 | ERROR | [x] Concat operator must be surrounded by a single
     |       |     space
 193 | ERROR | [x] Concat operator must be surrounded by a single
     |       |     space
 196 | ERROR | [x] Short array syntax must be used to define arrays
 198 | ERROR | [ ] Concatenating translatable strings is not allowed,
     |       |     use placeholders instead and only one string
     |       |     literal
 198 | ERROR | [x] Concat operator must be surrounded by a single
     |       |     space
 198 | ERROR | [x] Concat operator must be surrounded by a single
     |       |     space
 203 | ERROR | [x] Short array syntax must be used to define arrays
 205 | ERROR | [ ] Concatenating translatable strings is not allowed,
     |       |     use placeholders instead and only one string
     |       |     literal
 205 | ERROR | [x] Concat operator must be surrounded by a single
     |       |     space
 205 | ERROR | [x] Concat operator must be surrounded by a single
     |       |     space
 209 | ERROR | [x] No space found before comment text; expected "//
     |       |     home page banner image" but found "//home page
     |       |     banner image"
 209 | ERROR | [x] Inline comments must start with a capital letter
 209 | ERROR | [x] Inline comments must end in full-stops,
     |       |     exclamation marks, question marks, colons, or
     |       |     closing parentheses
 217 | ERROR | [x] Short array syntax must be used to define arrays
 218 | ERROR | [x] Short array syntax must be used to define arrays
 226 | ERROR | [x] Expected 1 blank line after function; 3 found
 229 | ERROR | [ ] More than 2 empty lines are not allowed
 248 | ERROR | [x] Functions must not contain multiple empty lines in
     |       |     a row; found 2 empty lines
 250 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------
๐Ÿ“Œ Task
Status

RTBC

Version

3.0

Component

Code

Created by

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 @sourojeetpaul
  • Merge request !31Issue #3439389 : Fix Phpcs Errors. โ†’ (Open) created by sourojeetpaul
  • Status changed to Needs review 3 months ago
  • Fixed all the coding standard issues reported by Phpcs. Here is the corresponding MR link. Please have a look:
    https://git.drupalcode.org/project/school_theme/-/merge_requests/31

  • Status changed to Needs work 2 months ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines clarkssquared

    Hi

    I applied your MR !31 and I can still see many PHPCS errors in my end

    โžœ  school_theme git:(master) โœ— curl https://git.drupalcode.org/project/school_theme/-/merge_requests/31.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 12742    0 12742    0     0  24997      0 --:--:-- --:--:-- --:--:-- 25281
    patching file school.theme
    โžœ  school_theme git:(master) โœ—  ..
    โžœ  contrib git:(master) โœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml school_theme 
    
    FILE: ...ubing/Projects/d9/d9-local/web/themes/contrib/school_theme/school.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: ...-subing/Projects/d9/d9-local/web/themes/contrib/school_theme/css/style.css
    --------------------------------------------------------------------------------
    FOUND 369 ERRORS AFFECTING 230 LINES
    --------------------------------------------------------------------------------
       1 | ERROR | [x] Selectors must be on a single line
       2 | ERROR | [x] Selectors must be on a single line
       3 | ERROR | [x] Selectors must be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       4 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       5 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       6 | ERROR | [x] Multiple selectors should each be on a single line
       7 | ERROR | [x] Multiple selectors should each be on a single line
       7 | ERROR | [x] Multiple selectors should each be on a single line
       7 | ERROR | [x] Multiple selectors should each be on a single line
       7 | ERROR | [x] Multiple selectors should each be on a single line
       7 | ERROR | [x] Multiple selectors should each be on a single line
       7 | ERROR | [x] Multiple selectors should each be on a single line
       7 | ERROR | [x] Multiple selectors should each be on a single line
      17 | ERROR | [x] Multiple selectors should each be on a single line
      17 | ERROR | [x] Multiple selectors should each be on a single line
      17 | ERROR | [x] Multiple selectors should each be on a single line
      17 | ERROR | [x] Multiple selectors should each be on a single line
      17 | ERROR | [x] Multiple selectors should each be on a single line
      17 | ERROR | [x] Multiple selectors should each be on a single line
      17 | ERROR | [x] Multiple selectors should each be on a single line
      17 | ERROR | [x] Multiple selectors should each be on a single line
      17 | ERROR | [x] Multiple selectors should each be on a single line
      17 | ERROR | [x] Multiple selectors should each be on a single line
      45 | ERROR | [x] Closing brace of class definition must be on new line
     137 | ERROR | [x] CSS colours must be defined in lowercase; expected #00a0a0
         |       |     but found #00A0A0
     144 | ERROR | [x] CSS colours must be defined in lowercase; expected #00a0a0
         |       |     but found #00A0A0
     152 | ERROR | [x] Multiple selectors should each be on a single line
     160 | ERROR | [x] Multiple selectors should each be on a single line
     190 | ERROR | [x] Closing brace of class definition must be on new line
     194 | ERROR | [x] CSS colours must be defined in lowercase; expected #221e20
         |       |     but found #221E20
     194 | ERROR | [x] Closing brace of class definition must be on new line
     195 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
     196 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     197 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     197 | ERROR | [x] Closing brace of class definition must be on new line
     215 | ERROR | [x] Closing brace of class definition must be on new line
     216 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
     217 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     218 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
     218 | ERROR | [x] Closing brace of class definition must be on new line
     219 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
     220 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     221 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     222 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
     234 | ERROR | [x] CSS colours must be defined in lowercase; expected #2c2c2c
         |       |     but found #2C2C2C
     244 | ERROR | [x] CSS colours must be defined in lowercase; expected #2c2c2c
         |       |     but found #2C2C2C
     266 | ERROR | [x] CSS colours must be defined in lowercase; expected #221e20
         |       |     but found #221E20
     275 | ERROR | [x] CSS colours must be defined in lowercase; expected #ededed
         |       |     but found #EDEDED
     281 | ERROR | [x] CSS colours must be defined in lowercase; expected #e5e6f0
         |       |     but found #E5E6F0
     282 | ERROR | [x] CSS colours must be defined in lowercase; expected #e5e6f0
         |       |     but found #E5E6F0
     283 | ERROR | [x] CSS colours must be defined in lowercase; expected #e5e6f0
         |       |     but found #E5E6F0
     287 | ERROR | [x] CSS colours must be defined in lowercase; expected #221e20
         |       |     but found #221E20
     295 | ERROR | [x] Closing brace of class definition must be on new line
     296 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
     297 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     298 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     298 | ERROR | [x] Closing brace of class definition must be on new line
     299 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
     300 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     301 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     301 | ERROR | [x] Closing brace of class definition must be on new line
     308 | ERROR | [x] Closing brace of class definition must be on new line
     309 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
     310 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     310 | ERROR | [x] Closing brace of class definition must be on new line
     311 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
     312 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     313 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     314 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     315 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     315 | ERROR | [x] Closing brace of class definition must be on new line
     316 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 6
     317 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
     318 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
     318 | ERROR | [x] Closing brace of class definition must be on new line
     319 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 6
     320 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
     320 | ERROR | [x] Closing brace of class definition must be on new line
     321 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 6
     322 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
     323 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
     324 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
     325 | ERROR | [x] Line indented incorrectly; expect

    I didn't pasted all the PHPCS errors and warning because it's way too many, moving this to neeeds work.

  • Issue was unassigned.
  • Status changed to Needs review 2 months ago
  • Hello clarkssquared,
    Sorry for the overlook on the remaining one, added a new commit now which targets that as well!
    But I'm afraid that you have not followed "Steps to reproduce" properly, there I haven't included CSS files in PHPCS config purposefully as I find PHPCS is not the best tool to find CSS related errors and address them as well, there are other specific tools which can be well suited for this purpose like styelint or so. I've mentioned the same to you on such a similar issue https://www.drupal.org/project/january_theme/issues/3364794#comment-1554... ๐Ÿ“Œ Fix the errors/warnings reported by PHP_CodeSniffer Needs work

    So here I'm not addressing the CSS issues. Though thanks for pointing out the CSS related errors, I'll try to reproduce the same by running stylelint and will provide a patch for it by creating a separate issue on it, please keep an eye on that!

    This issue ticket only concerns about errors related to the following files:
    php,module,inc,install,test,profile,theme,info,txt,yml

    It seems that only one file change was remaining which is the libraries.yml file as pointed out by PHPCS after applying the previous patch. Though I'm not getting any error or warning for the info.yml file which you've mentioned here.

    FILE: /app/web/themes/custom/school_theme-3439389/school.libraries.yml
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
     16 | ERROR | [x] Expected 1 newline at end of file; 2 found
    ----------------------------------------------------------------------
    

    The new commit on the MR solves the issue as well, please have a look!
    https://git.drupalcode.org/project/school_theme/-/merge_requests/31/diff...

    I'll be creating an issue for CSS related error real soon and address the same as well!

  • Hi,
    I applied MR !31 and still getting some warnings and one error after executing
    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,yml modules/contrib/school_theme/

    FILE: /app/web/themes/contrib/school_theme/school.theme
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
    ----------------------------------------------------------------------
      9 | WARNING | [x] Unused use statement
     10 | WARNING | [x] Unused use statement
     12 | WARNING | [x] Unused use statement
     14 | WARNING | [x] Unused use statement
     71 | WARNING | [ ] Hook implementations should not duplicate @param
        |         |     documentation
     73 | WARNING | [ ] Hook implementations should not duplicate @param
        |         |     documentation
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    
    FILE: ...eb/themes/contrib/school_theme/includes/flexslider/changelog.txt
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------
     13 | WARNING | Line exceeds 80 characters; contains 103 characters
    ----------------------------------------------------------------------
    
    
    FILE: /app/web/themes/contrib/school_theme/PATCHES.txt
    ----------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    ----------------------------------------------------------------------
     1 | WARNING | [ ] Line exceeds 80 characters; contains 104
       |         |     characters
     5 | ERROR   | [x] Expected 1 newline at end of file; 3 found
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    
    FILE: /app/web/themes/contrib/school_theme/school.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
    ----------------------------------------------------------------------
    
  • Status changed to Needs work 26 days ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev16.addweb

    silvi.addweb โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs review 25 days ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev16.addweb

    Hi, I have fix remaining phpcs issues, Please review.

  • Status changed to RTBC 25 days ago
  • Hi, I have reviewed the changes and the MR applies cleanly.
    Moving to RTBC+

Production build 0.69.0 2024