Fix the issues reported by phpcs

Created on 22 July 2024, 4 months ago

Problem/Motivation

There is a file that needs to be fixed with coding standards.
Here is the command: -

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

FILE: ...ww\drupal10\modules\contrib\address_suggestion\address_suggestion.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: ...4\www\drupal10\modules\contrib\address_suggestion\js\address_map\arcgis.js
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 47 | ERROR | [x] Functions must not contain multiple empty lines in a row;
    |       |     found 2 empty lines
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...4\www\drupal10\modules\contrib\address_suggestion\js\address_map\google.js
--------------------------------------------------------------------------------
FOUND 24 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 16 | ERROR | [x] Expected 1 space before "<"; 0 found
 16 | ERROR | [x] Expected 1 space after "<"; 0 found
 16 | ERROR | [x] Expected 1 space before "="; 0 found
 16 | ERROR | [x] Expected 1 space after "="; 0 found
 16 | ERROR | [x] Expected 1 space before "="; 0 found
 16 | ERROR | [x] Expected 1 space after "="; 0 found
 16 | ERROR | [x] Expected 1 space before "="; 0 found
 16 | ERROR | [x] Expected 1 space after "="; 0 found
 16 | ERROR | [x] Expected 1 space before "="; 0 found
 16 | ERROR | [x] Expected 1 space after "="; 0 found
 16 | ERROR | [x] Expected 1 space before "="; 0 found
 16 | ERROR | [x] Expected 1 space after "="; 0 found
 17 | ERROR | [x] Expected 1 space before "="; 0 found
 17 | ERROR | [x] Expected 1 space after "="; 0 found
 17 | ERROR | [x] Expected 1 space before "="; 0 found
 17 | ERROR | [x] Expected 1 space after "="; 0 found
 17 | ERROR | [x] Expected 1 space before ">"; 0 found
 17 | ERROR | [x] Expected 1 space after ">"; 0 found
 17 | ERROR | [x] Expected 1 space before "<"; 0 found
 17 | ERROR | [x] Expected 1 space after "<"; 0 found
 17 | ERROR | [x] Expected 1 space before "/"; 0 found
 17 | ERROR | [x] Expected 1 space after "/"; 0 found
 17 | ERROR | [x] Expected 1 space before ">"; 0 found
 17 | ERROR | [x] Expected 1 space after ">"; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 24 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...p64\www\drupal10\modules\contrib\address_suggestion\js\address_map\here.js
--------------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------
 16 | ERROR | [x] Expected 1 space before "?"; 0 found
 16 | ERROR | [x] Expected 1 space after "?"; 0 found
 39 | ERROR | [x] Expected 1 space before "?"; 0 found
 39 | ERROR | [x] Expected 1 space after "?"; 0 found
 39 | ERROR | [x] Expected 1 space before "?"; 0 found
 39 | ERROR | [x] Expected 1 space after "?"; 0 found
 59 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
    |       |     found "false"
 60 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 62 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
    |       |     found "false"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...4\www\drupal10\modules\contrib\address_suggestion\js\address_map\mapbox.js
--------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
  1 | ERROR | [x] Additional whitespace found at start of file
 17 | ERROR | [x] Expected 1 space before "?"; 0 found
 17 | ERROR | [x] Expected 1 space after "?"; 0 found
 30 | ERROR | [x] Expected 1 space before "?"; 0 found
 30 | ERROR | [x] Expected 1 space after "?"; 0 found
 30 | ERROR | [x] Expected 1 space before "?"; 0 found
 30 | ERROR | [x] Expected 1 space after "?"; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...www\drupal10\modules\contrib\address_suggestion\js\address_map\mapquest.js
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 16 | ERROR | [x] Expected 1 space before "?"; 0 found
 16 | ERROR | [x] Expected 1 space after "?"; 0 found
 27 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
    |       |     found "false"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...mp64\www\drupal10\modules\contrib\address_suggestion\js\address_map\osm.js
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 1 LINE
--------------------------------------------------------------------------------
 20 | ERROR | [x] Expected 1 space before "?"; 0 found
 20 | ERROR | [x] Expected 1 space after "?"; 0 found
 20 | ERROR | [x] Expected 1 space before "?"; 0 found
 20 | ERROR | [x] Expected 1 space after "?"; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...4\www\drupal10\modules\contrib\address_suggestion\js\address_map\tomtom.js
--------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 17 | ERROR | [x] Expected 1 space before "?"; 0 found
 17 | ERROR | [x] Expected 1 space after "?"; 0 found
 25 | ERROR | [x] Expected 1 space before "?"; 0 found
 25 | ERROR | [x] Expected 1 space after "?"; 0 found
 25 | ERROR | [x] Expected 1 space before "?"; 0 found
 25 | ERROR | [x] Expected 1 space after "?"; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...\drupal10\modules\contrib\address_suggestion\js\build\addressSuggestion.js
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | WARNING | File appears to be minified and cannot be processed
--------------------------------------------------------------------------------


FILE: ...ion\js\ckeditor5_plugins\addressSuggestion\src\AddressSuggestionEditing.js
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 23 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
    |       |     found "true"
 26 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
    |       |     found "true"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...n\js\ckeditor5_plugins\addressSuggestion\src\AddressSuggestionIcon-view.js
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 123 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
 134 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...ggestion\js\ckeditor5_plugins\addressSuggestion\src\AddressSuggestionUI.js
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 24 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
    |       |     found "true"
 88 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but
    |       |     found "null"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...gestion\js\ckeditor5_plugins\addressSuggestion\src\InsertAddressCommand.js
--------------------------------------------------------------------------------
FOUND 39 ERRORS AFFECTING 6 LINES
--------------------------------------------------------------------------------
  8 | ERROR | [x] Expected 1 space before "<"; 0 found
  8 | ERROR | [x] Expected 1 space after "<"; 0 found
  8 | ERROR | [x] Expected 1 space before "="; 0 found
  8 | ERROR | [x] Expected 1 space after "="; 0 found
  8 | ERROR | [x] Expected 1 space before ">"; 0 found
  8 | ERROR | [x] Expected 1 space after ">"; 0 found
  8 | ERROR | [x] Expected 1 space before "<"; 0 found
  8 | ERROR | [x] Expected 1 space after "<"; 0 found
  8 | ERROR | [x] Expected 1 space before "/"; 0 found
  8 | ERROR | [x] Expected 1 space after "/"; 0 found
  8 | ERROR | [x] Expected 1 space before ">"; 0 found
  8 | ERROR | [x] Expected 1 space after ">"; 0 found
 10 | ERROR | [x] Expected 1 space before "<"; 0 found
 10 | ERROR | [x] Expected 1 space after "<"; 0 found
 10 | ERROR | [x] Expected 1 space before "="; 0 found
 10 | ERROR | [x] Expected 1 space after "="; 0 found
 10 | ERROR | [x] Expected 1 space before "="; 0 found
 10 | ERROR | [x] Expected 1 space after "="; 0 found
 10 | ERROR | [x] Expected 1 space before "="; 0 found
 10 | ERROR | [x] Expected 1 space after "="; 0 found
 10 | ERROR | [x] Expected 1 space before "="; 0 found
 10 | ERROR | [x] Expected 1 space after "="; 0 found
 10 | ERROR | [x] Expected 1 space before "="; 0 found
 10 | ERROR | [x] Expected 1 space after "="; 0 found
 11 | ERROR | [x] Expected 1 space before "="; 0 found
 11 | ERROR | [x] Expected 1 space after "="; 0 found
 11 | ERROR | [x] Expected 1 space before "="; 0 found
 11 | ERROR | [x] Expected 1 space after "="; 0 found
 11 | ERROR | [x] Expected 1 space before ">"; 0 found
 11 | ERROR | [x] Expected 1 space after ">"; 0 found
 11 | ERROR | [x] Expected 1 space before "<"; 0 found
 11 | ERROR | [x] Expected 1 space after "<"; 0 found
 11 | ERROR | [x] Expected 1 space before "/"; 0 found
 11 | ERROR | [x] Expected 1 space after "/"; 0 found
 11 | ERROR | [x] Expected 1 space before ">"; 0 found
 11 | ERROR | [x] Expected 1 space after ">"; 0 found
 30 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but
    |       |     found "null"
 33 | ERROR | [x] Expected 1 newline at end of file; 2 found
 34 | ERROR | [x] Additional whitespace found at end of file
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 39 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...www\drupal10\modules\contrib\address_suggestion\js\continent_suggestion.js
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
 10 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 16 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 27 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 36 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...:\wamp64\www\drupal10\modules\contrib\address_suggestion\webpack.config.js
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
 19 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
    |       |     found "true"
 24 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
    |       |     found "false"
 28 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
    |       |     found "false"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 4.2 secs; Memory: 14MB

Steps to reproduce

Run PHPCS on this module.

Proposed resolution

Fix the coding standards.

Remaining tasks

Submit the patch either MR.

User interface changes

none

API changes

none

Data model changes

none

📌 Task
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

🇮🇳India amanbtr72

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 @amanbtr72
  • First commit to issue fork.
  • Assigned to bhaveshdas
  • Pipeline finished with Success
    4 months ago
    Total: 135s
    #230877
  • Issue was unassigned.
  • Status changed to Needs review 4 months ago
  • 🇮🇳India bhaveshdas

    Hi, I've fixed some PHPCS issues, but one warning remains.
    Can someone take a look at it?

    Thankyou !!

    FILE: /var/www/html/drupal-contri-d10/modules/custom/address_suggestion-3463031/js/build/addressSuggestion.js
    -------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------
     1 | WARNING | File appears to be minified and cannot be processed
    -------------------------------------------------------------------------------------------------------------
    
    Time: 728ms; Memory: 14MB
    
  • Status changed to Needs work 4 months ago
  • Status changed to Closed: won't fix 4 months ago
  • 🇫🇷France lazzyvn paris

    why do you wanna correct the js style with phpcs? I remind you that PHPS is NOT for js and css. if you want to fix it with PHPCBF, it will be totally wrong. I think you just run phpcfb without testing. Example of fixing true vs TRUE, false vs FALSE not working with js.
    The module is passed to Phpcs with ci on gitlab. you don't need to repair it.

Production build 0.71.5 2024