Fix the issues reported by phpcs

Created on 8 July 2024, 2 months ago
Updated 2 September 2024, 6 days ago

Problem/Motivation

Running :-
vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig web/modules/contrib/ckeditor5_dark_mode/
returns the following warnings/errors, which should be fixed.

FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/ckeditor5_dark_mode/css/dark.css
---------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
---------------------------------------------------------------------------------------------
12 | ERROR | [x] Expected 0 spaces before semicolon in style definition; 1 found
20 | ERROR | [x] Expected 0 spaces before semicolon in style definition; 1 found
24 | ERROR | [x] Expected 0 spaces before semicolon in style definition; 1 found
104 | ERROR | [x] Selectors must be on a single line
105 | ERROR | [x] Blank lines are not allowed between class names
106 | ERROR | [ ] Style definitions must end with a semicolon
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------

FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/ckeditor5_dark_mode/README.md
------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------
3 | WARNING | [ ] Line exceeds 80 characters; contains 140 characters
4 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
4 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------

FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/ckeditor5_dark_mode/js/build/darkMode.js
-----------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------
1 | WARNING | File appears to be minified and cannot be processed
-----------------------------------------------------------------------------------------------------

FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/ckeditor5_dark_mode/js/ckeditor5_plugins/darkMode/src/darkui.js
----------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
----------------------------------------------------------------------------------------------------------------------------
26 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
37 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
47 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
55 | ERROR | [x] Expected 1 newline at end of file; 2 found
56 | ERROR | [x] Additional whitespace found at end of file
----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------

FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/ckeditor5_dark_mode/ckeditor5_dark_mode.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: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/ckeditor5_dark_mode/webpack.config.js
--------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------
20 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
25 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
29 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------

Time: 97ms; Memory: 10MB

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

šŸ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India Prem Suthar gujrat

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 @Prem Suthar
  • First commit to issue fork.
  • Status changed to Needs review about 2 months ago
  • šŸ‡®šŸ‡³India Sourav_Paul Kolkata

    @tzatziki Kindly review changes & merge it..

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

    Hi @Sourav_Paul,

    I applied MR!1 and it was applied smoothly. However, I still encountered some issues after I ran

    </code>.
    
    <code>āžœ  ckeditor5_dark_mode git:(1.0.0) curl https://git.drupalcode.org/project/ckeditor5_dark_mode/-/merge_requests/1.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  2045    0  2045    0     0   4789      0 --:--:-- --:--:-- --:--:--  4789
    patching file README.md
    patching file css/dark.css
    āžœ  ckeditor5_dark_mode git:(1.0.0) āœ— ..
    āžœ  contrib phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml ckeditor5_dark_mode
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/ckeditor5_dark_mode/css/dark.css
    -----------------------------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    -----------------------------------------------------------------------------------------------------
     104 | ERROR | [x] Selectors must be on a single line
     105 | ERROR | [x] Blank lines are not allowed between class names
     106 | ERROR | [ ] Style definitions must end with a semicolon
    -----------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------
    
    Time: 125ms; Memory: 10MB
    
    āžœ  contrib

    Thank you.

  • Status changed to Needs review about 2 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi,

    Please Review MR!1. Thank you.

  • Hi, patch was applied cleanly.

    curl https://git.drupalcode.org/project/ckeditor5_dark_mode/-/merge_requests/1.diff | git apply -v
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  6314    0  6314    0     0  11343      0 --:--:-- --:--:-- --:--:-- 11846
    Checking patch README.md...
    Checking patch css/dark.css...
    Applied patch README.md cleanly.
    Applied patch css/dark.css cleanly.
    

    Tested with phpcs after applying patch, did not encounter any errors.

  • šŸ‡®šŸ‡³India Sourav_Paul Kolkata

    @tzatziki Could you please look into this MR?

  • Status changed to RTBC 6 days ago
  • šŸ‡®šŸ‡³India Tirupati_Singh

    Hi, I've applied the provided MR as a patch and it applied cleanly with no errors. After patch and running command vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig all the mentioned phpcs issues resolved successfully and the module is working perfect. Attaching the screenshots for reference.

    Thanks!

Production build 0.71.5 2024