Problem/Motivation

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,yaml,feature,js,json,ts,tsx,feature,twig

FILE: /home/drupal/myproject/varbase_heroslider_media/package.json
-------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------
 140 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------

FILE: /home/drupal/myproject/varbase_heroslider_media/gulpfile.js
---------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
---------------------------------------------------------------------------------------------
 18 | ERROR | [x] Expected 0 spaces before opening parenthesis; 1 found
 21 | 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"
 37 | ERROR | [x] Expected 0 spaces before opening parenthesis; 1 found
---------------------------------------------------------------------------------------------

FILE: /home/drupal/myproject/varbase_heroslider_media/varbase_heroslider_media.install
---------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------
  16 | WARNING | Line exceeds 80 characters; contains 99 characters
 102 | WARNING | Line exceeds 80 characters; contains 82 characters
---------------------------------------------------------------------------------------------

FILE: /home/drupal/myproject/varbase_heroslider_media/templates/node--varbase-heroslider-media.html.twig
---------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------
 132 | ERROR | [x] Expected 1 newline at end of file; 0 found
---------------------------------------------------------------------------------------------------------------

FILE: /home/drupal/myproject/varbase_heroslider_media/js/video.heroslider.local.js
-------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------
 15 | ERROR | [x] Expected 1 space before "-"; 0 found
 15 | ERROR | [x] Expected 1 space after "-"; 0 found
 34 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 55 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
-------------------------------------------------------------------------------------------

FILE: /home/drupal/myproject/varbase_heroslider_media/js/video.heroslider.youtube.js
---------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------
 17 | ERROR | [x] Expected 1 space before "-"; 0 found
 17 | ERROR | [x] Expected 1 space after "-"; 0 found
 29 | ERROR | [x] Expected 1 space before "-"; 0 found
 29 | ERROR | [x] Expected 1 space after "-"; 0 found
 65 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
---------------------------------------------------------------------------------------------

FILE: /home/drupal/myproject/varbase_heroslider_media/js/video.heroslider.vimeo.js
---------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------
 17 | ERROR | [x] Expected 1 space before "-"; 0 found
 17 | ERROR | [x] Expected 1 space after "-"; 0 found
 29 | ERROR | [x] Expected 1 space before "-"; 0 found
 29 | ERROR | [x] Expected 1 space after "-"; 0 found
 65 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
---------------------------------------------------------------------------------------------

FILE: /home/drupal/myproject/varbase_heroslider_media/js/oembed-frame.heroslider.youtube.js
--------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
--------------------------------------------------------------------------------------------------
  29 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
  73 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  82 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
  95 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  97 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 110 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
--------------------------------------------------------------------------------------------------

FILE: /home/drupal/myproject/varbase_heroslider_media/js/oembed-frame.heroslider.vimeo.js
------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
------------------------------------------------------------------------------------------------
 30 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 40 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 41 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 42 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 43 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 56 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 75 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
------------------------------------------------------------------------------------------------

Proposed resolution

Moving to check with:

phpcs --standard=Drupal --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml,js /var/www/html/products/varbase_heroslider_media/ --ignore="/var/www/html/products/varbase_heroslider_media/node_modules/,gulpfile.js"

phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml,js /var/www/html/products/varbase_heroslider_media/ --ignore="/var/www/html/products/varbase_heroslider_media/node_modules/,gulpfile.js"

Using the local configs for checks:

  • yarn phpcs
  • yarn lint:js
  • yarn lint:css
  • yarn lint:yaml

Remaining tasks

  • ✅ File an issue about this project
  • ✅ Addition/Change/Update/Fix to this project
  • ✅ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ➖ Accessibility and Readability
  • ✅ Code review from 1 Varbase core team member
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Update Release Notes and Update Helper on new feature change/addition
  • ✅ Release Varbase 9.0.9, varbase_heroslider_media-9.0.6

Varbase update type

  • ✅ No Update
  • ➖ Optional Update
  • ➖ Forced Update
  • ➖ Forced Update if Unchanged

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Dharti Patel created an issue. See original summary.

dharti patel’s picture

Assigned: Unassigned » dharti patel
dharti patel’s picture

Assigned: dharti patel » Unassigned
Status: Active » Needs review
StatusFileSize
new9.18 KB

Hello,

I have created a patch to fix this issue.
Kindly review the patch.

Thanks!

mitthukumawat made their first commit to this issue’s fork.

rajab natshah’s picture

Status: Needs review » Needs work

The fixes changes code in wrong format
like

`.slide--${currentSlide}.slick - active`
rajab natshah’s picture

Using the following commands:

## varbase_heroslider_media
phpcs --standard=Drupal --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_heroslider_media/ --ignore=/var/www/html/products/varbase_heroslider_media/node_modules/
phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_heroslider_media/ --ignore=/var/www/html/products/varbase_heroslider_media/node_modules/

Please, follow with ⚒ Contributing

Check Standards/Practice Coding And Linting


Tested:
rajab@vardot-dev:/var/www/html/products/varbase_heroslider_media$ phpcs --standard=Drupal --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_heroslider_media/ --ignore=/var/www/html/products/varbase_heroslider_media/node_modules/

FILE: /var/www/html/products/varbase_heroslider_media/varbase_heroslider_media.install
--------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------------
  16 | WARNING | Line exceeds 80 characters; contains 99 characters
 102 | WARNING | Line exceeds 80 characters; contains 82 characters
--------------------------------------------------------------------------------------

Time: 739ms; Memory: 10MB

rajab natshah’s picture

Issue summary: View changes

Noticed that you'd added js to the phpcs check

rajab@vardot-dev:/var/www/html/products/varbase_heroslider_media$ phpcs --standard=Drupal --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml,js /var/www/html/products/varbase_heroslider_media/ --ignore=/var/www/html/products/varbase_heroslider_media/node_modules/

FILE: /var/www/html/products/varbase_heroslider_media/varbase_heroslider_media.install
--------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------------
  16 | WARNING | Line exceeds 80 characters; contains 99 characters
 102 | WARNING | Line exceeds 80 characters; contains 82 characters
--------------------------------------------------------------------------------------


FILE: /var/www/html/products/varbase_heroslider_media/gulpfile.js
---------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
---------------------------------------------------------------------------------------------
 18 | ERROR | [x] Expected 0 spaces before opening parenthesis; 1 found
 21 | 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"
 37 | ERROR | [x] Expected 0 spaces before opening parenthesis; 1 found
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------


FILE: /var/www/html/products/varbase_heroslider_media/js/video.heroslider.local.js
-------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------
 15 | ERROR | [x] Expected 1 space before "-"; 0 found
 15 | ERROR | [x] Expected 1 space after "-"; 0 found
 34 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 55 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
-------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------


FILE: /var/www/html/products/varbase_heroslider_media/js/oembed-frame.heroslider.youtube.js
----------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
----------------------------------------------------------------------------------------------
  29 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
  73 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  82 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
  95 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  97 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 110 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------


FILE: /var/www/html/products/varbase_heroslider_media/js/oembed-frame.heroslider.vimeo.js
---------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
---------------------------------------------------------------------------------------------
 30 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 40 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 41 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 42 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 43 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 56 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 75 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------


FILE: /var/www/html/products/varbase_heroslider_media/js/video.heroslider.vimeo.js
---------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------
 17 | ERROR | [x] Expected 1 space before "-"; 0 found
 17 | ERROR | [x] Expected 1 space after "-"; 0 found
 29 | ERROR | [x] Expected 1 space before "-"; 0 found
 29 | ERROR | [x] Expected 1 space after "-"; 0 found
 65 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------


FILE: /var/www/html/products/varbase_heroslider_media/js/video.heroslider.youtube.js
---------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------
 17 | ERROR | [x] Expected 1 space before "-"; 0 found
 17 | ERROR | [x] Expected 1 space after "-"; 0 found
 29 | ERROR | [x] Expected 1 space before "-"; 0 found
 29 | ERROR | [x] Expected 1 space after "-"; 0 found
 65 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------

Time: 1.36 secs; Memory: 10MB


Better to Lint JS with yarn lint:js

rajab@vardot-dev:/var/www/html/products/varbase_heroslider_media$ yarn lint:js
yarn run v1.22.19
$ node ./node_modules/eslint/bin/eslint.js --config=.eslintrc.json --ext .js .

/var/www/html/products/varbase_heroslider_media/js/oembed-frame.heroslider.vimeo.js
  12:48  warning  Unexpected unnamed function  func-names
  26:7   warning  Unexpected unnamed function  func-names
  48:33  warning  Unexpected unnamed function  func-names
  53:32  warning  Unexpected unnamed function  func-names
  59:32  warning  Unexpected unnamed function  func-names
  60:38  warning  Unexpected unnamed function  func-names

/var/www/html/products/varbase_heroslider_media/js/oembed-frame.heroslider.youtube.js
  12:48  warning  Unexpected unnamed function                           func-names
  25:7   warning  Unexpected unnamed function                           func-names
  68:24  error    'onPlayerReady' was used before it was defined        no-use-before-define
  69:30  error    'onPlayerStateChange' was used before it was defined  no-use-before-define

/var/www/html/products/varbase_heroslider_media/js/video.heroslider.local.js
   6:2   warning  Unexpected unnamed function                          func-names
   9:28  warning  Unexpected unnamed function                          func-names
  13:11  warning  Unexpected unnamed function                          func-names
  35:36  error    'onPause' was used before it was defined             no-use-before-define
  36:36  error    'onFinish' was used before it was defined            no-use-before-define
  37:35  error    'onPlayProgress' was used before it was defined      no-use-before-define
  46:67  warning  Unexpected unnamed function                          func-names
  58:36  warning  Too many nested callbacks (4). Maximum allowed is 3  max-nested-callbacks
  58:36  warning  Unexpected unnamed function                          func-names
  78:28  error    'onPause' was used before it was defined             no-use-before-define
  79:28  error    'onFinish' was used before it was defined            no-use-before-define
  80:27  error    'onPlayProgress' was used before it was defined      no-use-before-define

/var/www/html/products/varbase_heroslider_media/js/video.heroslider.vimeo.js
   6:2   warning  Unexpected unnamed function            func-names
  16:9   warning  Unexpected unnamed function            func-names
  16:47  warning  'nextSlide' is defined but never used  no-unused-vars
  28:38  warning  Unexpected unnamed function            func-names
  46:37  warning  Unexpected unnamed function            func-names

/var/www/html/products/varbase_heroslider_media/js/video.heroslider.youtube.js
   6:2   warning  Unexpected unnamed function            func-names
  16:9   warning  Unexpected unnamed function            func-names
  16:47  warning  'nextSlide' is defined but never used  no-unused-vars
  28:38  warning  Unexpected unnamed function            func-names
  46:37  warning  Unexpected unnamed function            func-names

✖ 32 problems (8 errors, 24 warnings)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

rajab natshah’s picture

Title: PHPCS coding standard issues » Fix Drupal coding standard and Drupal Practice
Version: 10.0.x-dev » 9.0.x-dev
Component: Documentation » Code
Assigned: Unassigned » rajab natshah
Status: Needs work » Active
rajab natshah’s picture

Title: PHPCS coding standard issues » Fix Drupal coding standard and Drupal Practice
Version: 10.0.x-dev » 9.0.x-dev
Component: Documentation » Code
Assigned: dharti patel » Unassigned
rajab natshah’s picture

Moving to check with:

phpcs --standard=Drupal --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml,js /var/www/html/products/varbase_heroslider_media/ --ignore="/var/www/html/products/varbase_heroslider_media/node_modules/,gulpfile.js"

phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml,js /var/www/html/products/varbase_heroslider_media/ --ignore="/var/www/html/products/varbase_heroslider_media/node_modules/,gulpfile.js"

Using the local configs for checks:

  • yarn phpcs
  • yarn lint:js
  • yarn lint:css
  • yarn lint:yaml
rajab natshah’s picture

Title: Fix Drupal coding standard and Drupal Practice » Fix Drupal coding standard and Drupal Practice for Varbase Media Hero Slider

  • Rajab Natshah committed 1a42483 on 10.0.x
    Issue #3307464: Fix Drupal coding standard and Drupal Practice for...

  • Rajab Natshah committed 9295a2b on 9.0.x
    Issue #3307464: Fix Drupal coding standard and Drupal Practice for...
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Status: Active » Needs review
rajab natshah’s picture

Assigned: Unassigned » mohammed j. razem
Issue summary: View changes
Issue tags: +varbase-9.0.9, +varbase_heroslider_media-9.0.6
rajab natshah’s picture

Assigned: mohammed j. razem » Unassigned
rajab natshah’s picture

Status: Needs review » Fixed
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes

✅ Released Varbase 9.0.9

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.