Problem/Motivation
Fix the issues reported by PHPCS for Drupal and DrupalPractice standards in 2.0.x branch
Steps to reproduce
Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig smart_trim/
Proposed resolution
Fix all the issues mentioned below:
FILE: ...www/html/contribution/drupal8/web/modules/smart_trim-3351447/CHANGELOG.txt
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 16 WARNINGS AFFECTING 16 LINES
--------------------------------------------------------------------------------
3 | WARNING | Line exceeds 80 characters; contains 81 characters
4 | WARNING | Line exceeds 80 characters; contains 87 characters
5 | WARNING | Line exceeds 80 characters; contains 82 characters
10 | WARNING | Line exceeds 80 characters; contains 89 characters
12 | WARNING | Line exceeds 80 characters; contains 141 characters
13 | WARNING | Line exceeds 80 characters; contains 97 characters
14 | WARNING | Line exceeds 80 characters; contains 88 characters
15 | WARNING | Line exceeds 80 characters; contains 95 characters
18 | WARNING | Line exceeds 80 characters; contains 89 characters
19 | WARNING | Line exceeds 80 characters; contains 91 characters
25 | WARNING | Line exceeds 80 characters; contains 134 characters
27 | WARNING | Line exceeds 80 characters; contains 87 characters
28 | WARNING | Line exceeds 80 characters; contains 97 characters
32 | WARNING | Line exceeds 80 characters; contains 118 characters
33 | WARNING | Line exceeds 80 characters; contains 81 characters
35 | WARNING | Line exceeds 80 characters; contains 96 characters
--------------------------------------------------------------------------------
FILE: .../smart_trim-3351447/src/Plugin/Field/FieldFormatter/SmartTrimFormatter.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------
301 | WARNING | Only string literals should be passed to t() where possible
311 | WARNING | Only string literals should be passed to t() where possible
313 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------
FILE: ...ution/drupal8/web/modules/smart_trim-3351447/src/Truncate/TruncateHTML.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
36 | WARNING | The class short comment should describe what the class does and
| | not simply repeat the class name
--------------------------------------------------------------------------------
Time: 777ms; Memory: 10MB
Issue fork smart_trim-3351447
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
urvashi_vora commentedI am working on this, will provide a patch/MR shortly
Comment #4
urvashi_vora commentedComment #5
ultimike@urvashi_vora - thanks so much for doing this - just one tiny nit-pick above in comment 4...
-mike
Comment #6
avpadernoThe issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.
Comment #7
avpadernoComment #8
urvashi_vora commentedComment #9
urvashi_vora commentedHi @ultimike,
I have made the required changes, please verify.
Thanks
Comment #10
urvashi_vora commentedHi @apaderno,
I have updated the issue summary, Please review.
Thanks
Comment #11
avpadernoIt is quite hard to read the change log in that way. It would be better if the part of the line split by the previous line would be indented. I still think it would be better to leave those lines as they are, though, or change how they are formatted.
That short description does not say what the class purpose is. (No, a class does not implement itself.)
Class is not spelled correctly, since it is not at the beginning of a sentence, it is not a proper noun nor an acronym.
Comment #13
elberHi I just fixed the remaining errors, please revise.
Comment #14
avpadernoSee my previous comment. What I reported there is still valid.
Comment #15
elberHI I did a rebase and changed the changelog file according with Apaderno's comment. Please revise.
Comment #16
markie commentedthe repository needs local rebase again to fix conflicts.
Comment #17
elberI will do that
Comment #18
avpadernoThe splitted lines are still not indented, which means two spaces should be added to the second line.
Comment #19
elberHi I just fixed the characters limit in the contributor.md. Please revise
Comment #20
markie commentedWhoops.. I approved but then found this:
Comment #22
markie commentedUpdated the line that was at issue and merged. Thanks for your help!
Comment #23
avpadernoIndenting means adding two spaces at the beginning of the line.
The second line is not indented at all, and that makes reading the list of changes done difficult to read.