Problem/Motivation

Getting following error/warnings.

FILE: /var/www/html/modules/contrib/owl-carousel/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
15 | WARNING | Line exceeds 80 characters; contains 129 characters
69 | WARNING | Line exceeds 80 characters; contains 251 characters
----------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/owl-carousel/src/Plugin/Field/FieldFormatter/OwlCarouselFieldFormatter.php
---------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 13 WARNINGS AFFECTING 14 LINES
---------------------------------------------------------------------------------------------------------------------------
216 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
217 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
218 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
219 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
220 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
221 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
222 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
223 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
224 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
227 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
231 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
235 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
239 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
309 | ERROR | [x] Use null coalesce operator instead of ternary operator.
---------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/owl-carousel/src/OwlCarouselGlobal.php
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
30 | ERROR | [x] Use null coalesce operator instead of ternary operator.
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------

Time: 1.13 secs; Memory: 6MB

Steps to reproduce

Run following command

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

Proposed resolution

Above error/warnings need to be fixed.

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

samit.310@gmail.com created an issue. See original summary.

samitk’s picture

Assigned: samitk » Unassigned
Status: Needs work » Needs review
StatusFileSize
new4.78 KB

Above error/warnings are fixed.

Charchil Khandelwal made their first commit to this issue’s fork.

Charchil Khandelwal’s picture

Assigned: Unassigned » Charchil Khandelwal

Charchil Khandelwal’s picture

Assigned: Charchil Khandelwal » Unassigned

Created MR for this issue.

Thanks.

yashmalviya’s picture

Assigned: Unassigned » yashmalviya
Status: Needs review » Needs work
Issue tags: -, -
yashmalviya’s picture

Assigned: yashmalviya » Unassigned
Status: Needs work » Needs review
StatusFileSize
new5.35 KB

I have added a patch for the issue. Please Review

avpaderno’s picture

Title: Drupal Coding Standards Issues | phpcs » Fix the issues reported by phpcs
Priority: Normal » Minor
avpaderno’s picture

Status: Needs review » Needs work
-   * composer config repositories.owlcarousel2 '{"type":"package","package":{"name":"owlcarousel2/  owlcarousel2","version":"2.3.4","type":"drupal-library","dist":{"type":"zip","url":"https://github.com/OwlCarousel2/OwlCarousel2/archive/2.3.4.zip"}}}'
+   * composer config repositories.owlcarousel2 '{"type":"package",
+   "package":{"name":"owlcarousel2/  owlcarousel2",
+   "version":"2.3.4","type":"drupal-library","dist":{"type":"zip","url":"https://github.com/OwlCarousel2/OwlCarousel2/archive/2.3.4.zip"}}}'

Since that is a CLI command, it should be formatted differently. Probably, it is also better to leave that line as it is.

nitin_lama’s picture

Assigned: Unassigned » nitin_lama
nitin_lama’s picture

Status: Needs work » Needs review
StatusFileSize
new4.68 KB

Addressed #10

nitin_lama’s picture

Assigned: nitin_lama » Unassigned
avpaderno’s picture

Status: Needs review » Needs work
-This module integrates Owl Carousel, a touch enabled jQuery plugin that lets you create a beautiful, responsive carousel sliders.
+This module integrates Owl Carousel,
+a touch enabled jQuery plugin that lets you create a beautiful,
+ responsive carousel sliders.

Avoiding that lines exceed 80 characters does not mean making them 37 characters. Lines do not need to be split at punctuation marks.

imustakim’s picture

Assigned: Unassigned » imustakim
imustakim’s picture

Assigned: imustakim » Unassigned
Status: Needs work » Needs review
StatusFileSize
new7.11 KB

Patch Updated, addressed #14 and resolved a dependency injection warning.
Still there is one warning in readme.md file Line exceeds 80 characters; contains 251 characters, it contains link so assuming this can be ignored.
Rest of the warnings and errors are resolved.

ipwa’s picture

Updating credit.

  • ipwa committed f0959c87 on 3.0.x
    git commit -m 'Issue #3340450 by samit.310@gmail.com, nitin_lama,...

  • ipwa committed 84e20162 on 8.x-2.x
    git commit -m 'Issue #3340450 by samit.310@gmail.com, nitin_lama,...
ipwa’s picture

Version: 8.x-2.x-dev » 3.0.x-dev
Status: Needs review » Fixed

Thanks everyone!

Status: Fixed » Closed (fixed)

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