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.
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | 3340450-16.patch | 7.11 KB | imustakim |
| #12 | Coding-Standards-Issues-3340450-12.patch | 4.68 KB | nitin_lama |
| #8 | Coding-Standards-Issues-3340450-8.patch | 5.35 KB | yashmalviya |
| #2 | 3340450-2.patch | 4.78 KB | samitk |
Issue fork owlcarousel-3340450
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
Comment #2
samitk commentedAbove error/warnings are fixed.
Comment #4
Charchil Khandelwal commentedComment #6
Charchil Khandelwal commentedCreated MR for this issue.
Thanks.
Comment #7
yashmalviya commentedComment #8
yashmalviya commentedI have added a patch for the issue. Please Review
Comment #9
avpadernoComment #10
avpadernoSince that is a CLI command, it should be formatted differently. Probably, it is also better to leave that line as it is.
Comment #11
nitin_lamaComment #12
nitin_lamaAddressed #10
Comment #13
nitin_lamaComment #14
avpadernoAvoiding that lines exceed 80 characters does not mean making them 37 characters. Lines do not need to be split at punctuation marks.
Comment #15
imustakim commentedComment #16
imustakim commentedPatch 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.
Comment #17
ipwa commentedUpdating credit.
Comment #20
ipwa commentedThanks everyone!