FILE: ...mart_trim/src/Plugin/Field/FieldFormatter/SmartTrimFormatter.php
----------------------------------------------------------------------
FOUND 33 ERRORS AND 1 WARNING AFFECTING 34 LINES
----------------------------------------------------------------------
42 | ERROR | [x] Short array syntax must be used to define arrays
52 | ERROR | [x] Short array syntax must be used to define arrays
62 | ERROR | [x] Short array syntax must be used to define arrays
71 | ERROR | [x] Short array syntax must be used to define arrays
74 | ERROR | [x] Short array syntax must be used to define arrays
81 | ERROR | [x] Short array syntax must be used to define arrays
88 | ERROR | [x] Short array syntax must be used to define arrays
95 | ERROR | [x] Short array syntax must be used to define arrays
101 | ERROR | [x] Short array syntax must be used to define arrays
102 | ERROR | [x] Short array syntax must be used to define arrays
103 | ERROR | [x] Short array syntax must be used to define arrays
108 | ERROR | [x] Short array syntax must be used to define arrays
115 | ERROR | [x] Short array syntax must be used to define arrays
121 | ERROR | [x] Short array syntax must be used to define arrays
122 | ERROR | [x] Short array syntax must be used to define arrays
123 | ERROR | [x] Short array syntax must be used to define arrays
128 | ERROR | [x] Short array syntax must be used to define arrays
134 | ERROR | [x] Short array syntax must be used to define arrays
135 | ERROR | [x] Short array syntax must be used to define arrays
136 | ERROR | [x] Short array syntax must be used to define arrays
142 | ERROR | [x] Short array syntax must be used to define arrays
145 | ERROR | [x] Short array syntax must be used to define arrays
155 | ERROR | [x] Short array syntax must be used to define arrays
158 | ERROR | [x] Short array syntax must be used to define arrays
162 | ERROR | [x] Short array syntax must be used to define arrays
173 | ERROR | [x] Short array syntax must be used to define arrays
196 | ERROR | [x] Short array syntax must be used to define arrays
205 | ERROR | [x] Expected 1 space after ELSEIF keyword; 0 found
214 | ERROR | [x] Inline comments must end in full-stops,
| | exclamation marks, colons, question marks, or
| | closing parentheses
220 | ERROR | [x] Use "elseif" in place of "else if"
270 | WARNING | [ ] Only string literals should be passed to t()
| | where possible
275 | ERROR | [x] Short array syntax must be used to define arrays
276 | ERROR | [x] Short array syntax must be used to define arrays
286 | ERROR | [x] Short array syntax must be used to define arrays

Comments

deepanker_bhalla created an issue. See original summary.

deepanker_bhalla’s picture

Status: Needs work » Needs review
StatusFileSize
new8.24 KB

Hi,

Fixed all.

msankhala’s picture

Status: Needs review » Needs work

After applying the patch #2 there are few coding standard issues remaining.

smart_trim 8.x-1.x* phpcs --standard=Drupal .

FILE: ...s/user/Sites/htdocs/d8core/modules/contrib/smart_trim/README.txt
----------------------------------------------------------------------
FOUND 1 ERROR AND 5 WARNINGS AFFECTING 6 LINES
----------------------------------------------------------------------
  1 | WARNING | [ ] Line exceeds 80 characters; contains 204
    |         |     characters
  3 | WARNING | [ ] Line exceeds 80 characters; contains 166
    |         |     characters
 11 | WARNING | [ ] Line exceeds 80 characters; contains 171
    |         |     characters
 15 | WARNING | [ ] Line exceeds 80 characters; contains 137
    |         |     characters
 17 | WARNING | [ ] Line exceeds 80 characters; contains 164
    |         |     characters
 19 | ERROR   | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...mart_trim/src/Plugin/Field/FieldFormatter/SmartTrimFormatter.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 270 | WARNING | Only string literals should be passed to t() where
     |         | possible
----------------------------------------------------------------------

Time: 197ms; Memory: 8Mb

Once you fix this issue you can create a follow-up issue to fix README.txt file as per README template https://www.drupal.org/docs/develop/documenting-your-project/readme-temp...

deepanker_bhalla’s picture

Status: Needs work » Needs review
StatusFileSize
new10.94 KB

Hi,

Kindly check the patch for the mentioned issues.

msankhala’s picture

Status: Needs review » Needs work
+++ b/README.txt
@@ -1,6 +1,10 @@
+Smart Trim implements a new field formatter for textfields ¶
+(text, text_long, and text_with_summary, if you want to get technical) that ¶
...
+After installing and enabling Smart Trim, you should see a "Smart trimmed" ¶
+option in the format dropdown for your text fields. ¶

@@ -8,12 +12,17 @@ After installing and enabling Smart Trim, you should see a "Smart trimmed" optio
+The "More" link functionality may not make sense in many contexts, ¶
+and may be redundant in situations where "Read More" is included in ¶
...
+Note that HTML markup not seen by end-users will still be counted when ¶
...
+Smart Trim was initially developed by Ben Byrne while at ¶
+New Signature (bbyrne@newsignature.com) but Ben is now at ¶

There are trailing spaces at the end of these lines.

You can configure your editor to trim the trailing spaces on save to avoid this kind of issue.

msankhala’s picture

Also, submit interdiff whenever you are submitting a new patch which is different than the previous patch. See https://www.drupal.org/documentation/git/interdiff

dhirendra.mishra’s picture

Status: Needs work » Needs review
StatusFileSize
new1.82 KB
new10.93 KB

Thanks @msankhala for updates. I am uploading the interdiff file as well correct patch.Kindly check.

msankhala’s picture

Status: Needs review » Reviewed & tested by the community

@deepanker_bhalla, @dhirendra.mishra Good work. I can confirm the patch #7 is applying cleanly and fixing all the coding standard reported by the PHPCS. Here is the output:

❯ smart_trim 8.x-1.x* git apply -v 2997706-coding-standard-7.patch
Checking patch README.txt...
Checking patch src/Plugin/Field/FieldFormatter/SmartTrimFormatter.php...
Applied patch README.txt cleanly.
Applied patch src/Plugin/Field/FieldFormatter/SmartTrimFormatter.php cleanly.

❯ smart_trim 8.x-1.x* phpcs --standard=Drupal .

❯ smart_trim 8.x-1.x*

PHPCS is reporting no coding standard warning after applying the patch #7.

markie’s picture

Status: Reviewed & tested by the community » Needs work

Sorry for the delay, but #7 is now failing at Hunk #4 due to other patches applied. I am going to try to fix it manually.

markie’s picture

Status: Needs work » Fixed

did some phpcs fixes of my own and committed. Thanks for your help

Status: Fixed » Closed (fixed)

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