Fix the issues reported by phpcs

Created on 23 June 2023, over 1 year ago

-----------------------------------------------------------------------------------------------------------
FOUND 80 ERRORS AND 1 WARNING AFFECTING 63 LINES
-----------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
3 | ERROR | [x] Missing function doc comment
7 | ERROR | [x] Short array syntax must be used to define arrays
14 | ERROR | [x] Short array syntax must be used to define arrays
19 | ERROR | [x] Short array syntax must be used to define arrays
27 | ERROR | [x] Short array syntax must be used to define arrays
36 | ERROR | [x] Short array syntax must be used to define arrays
43 | ERROR | [x] Short array syntax must be used to define arrays
52 | ERROR | [x] Short array syntax must be used to define arrays
56 | ERROR | [x] Expected one space after the comma, 0 found
61 | ERROR | [x] Short array syntax must be used to define arrays
69 | ERROR | [x] Short array syntax must be used to define arrays
74 | ERROR | [x] Short array syntax must be used to define arrays
75 | ERROR | [x] Array indentation error, expected 6 spaces but found 4
76 | ERROR | [x] Array indentation error, expected 6 spaces but found 4
80 | ERROR | [x] Short array syntax must be used to define arrays
82 | WARNING | [ ] Avoid backslash escaping in translatable strings when possible, use "" quotes instead
88 | ERROR | [x] Short array syntax must be used to define arrays
89 | ERROR | [x] Array indentation error, expected 4 spaces but found 2
90 | ERROR | [x] Array indentation error, expected 4 spaces but found 3
91 | ERROR | [x] Array indentation error, expected 4 spaces but found 3
91 | ERROR | [x] Concat operator must be surrounded by a single space
91 | ERROR | [x] Concat operator must be surrounded by a single space
98 | ERROR | [x] Short array syntax must be used to define arrays
106 | ERROR | [x] Short array syntax must be used to define arrays
107 | ERROR | [x] Array indentation error, expected 4 spaces but found 2
108 | ERROR | [x] Array indentation error, expected 4 spaces but found 3
109 | ERROR | [x] Array indentation error, expected 4 spaces but found 3
109 | ERROR | [x] Concat operator must be surrounded by a single space
109 | ERROR | [x] Concat operator must be surrounded by a single space
116 | ERROR | [x] Short array syntax must be used to define arrays
124 | ERROR | [x] Short array syntax must be used to define arrays
125 | ERROR | [x] Array indentation error, expected 4 spaces but found 2
126 | ERROR | [x] Array indentation error, expected 4 spaces but found 3
127 | ERROR | [x] Array indentation error, expected 4 spaces but found 3
127 | ERROR | [x] Concat operator must be surrounded by a single space
127 | ERROR | [x] Concat operator must be surrounded by a single space
134 | ERROR | [x] Short array syntax must be used to define arrays
142 | ERROR | [x] Short array syntax must be used to define arrays
143 | ERROR | [x] Array indentation error, expected 4 spaces but found 2
144 | ERROR | [x] Array indentation error, expected 4 spaces but found 3
145 | ERROR | [x] Array indentation error, expected 4 spaces but found 3
145 | ERROR | [x] Concat operator must be surrounded by a single space
145 | ERROR | [x] Concat operator must be surrounded by a single space
152 | ERROR | [x] Short array syntax must be used to define arrays
160 | ERROR | [x] Short array syntax must be used to define arrays
161 | ERROR | [x] Array indentation error, expected 4 spaces but found 2
162 | ERROR | [x] Array indentation error, expected 4 spaces but found 3
163 | ERROR | [x] Array indentation error, expected 4 spaces but found 3
163 | ERROR | [x] Concat operator must be surrounded by a single space
163 | ERROR | [x] Concat operator must be surrounded by a single space
170 | ERROR | [x] Short array syntax must be used to define arrays
178 | ERROR | [x] Short array syntax must be used to define arrays
179 | ERROR | [x] Array indentation error, expected 4 spaces but found 2
180 | ERROR | [x] Array indentation error, expected 4 spaces but found 3
181 | ERROR | [x] Array indentation error, expected 4 spaces but found 3
181 | ERROR | [x] Concat operator must be surrounded by a single space
181 | ERROR | [x] Concat operator must be surrounded by a single space
187 | ERROR | [x] Whitespace found at end of line
188 | ERROR | [x] Short array syntax must be used to define arrays
196 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
196 | ERROR | [x] Short array syntax must be used to define arrays
197 | ERROR | [x] Array indentation error, expected 3 spaces but found 2
199 | ERROR | [x] Concat operator must be surrounded by a single space
199 | ERROR | [x] Concat operator must be surrounded by a single space
204 | ERROR | [x] Array closing indentation error, expected 1 spaces but found 2
206 | ERROR | [x] Short array syntax must be used to define arrays
214 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
214 | ERROR | [x] Short array syntax must be used to define arrays
215 | ERROR | [x] Array indentation error, expected 3 spaces but found 2
217 | ERROR | [x] Concat operator must be surrounded by a single space
217 | ERROR | [x] Concat operator must be surrounded by a single space
222 | ERROR | [x] Array closing indentation error, expected 1 spaces but found 2
223 | ERROR | [x] Whitespace found at end of line
224 | ERROR | [x] Short array syntax must be used to define arrays
232 | ERROR | [x] Short array syntax must be used to define arrays
233 | ERROR | [x] Array indentation error, expected 4 spaces but found 3
234 | ERROR | [x] Array indentation error, expected 4 spaces but found 3
235 | ERROR | [x] Array indentation error, expected 4 spaces but found 3
235 | ERROR | [x] Concat operator must be surrounded by a single space
235 | ERROR | [x] Concat operator must be surrounded by a single space
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 80 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------

šŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India sonam_sharma

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @sonam_sharma
  • Issue was unassigned.
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    The issue summary should always describe what the issue is trying to fix and, in the case of coding standards issues, show which command and arguments have been used and which report that command shown. In this way, project maintainers can verify the patch/MR fixes all the warnings/errors.

  • Status changed to Needs work 4 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @sonam_sharma,

    I applied patch #2 and it was failed.

    āžœ  restaurant_lite git:(8.x-1.x) curl https://www.drupal.org/files/issues/2023-06-23/3368957.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 13409  100 13409    0     0  38973      0 --:--:-- --:--:-- --:--:-- 38979
    patching file theme-settings.php
    Hunk #1 FAILED at 1.
    1 out of 1 hunk FAILED -- saving rejects to file theme-settings.php.rej
    āžœ  restaurant_lite git:(8.x-1.x) āœ— ..

    Furthermore, I encountered more issues than in the descriptions after I ran phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml

    I'll be attaching a screenshot for reference since it would be very long if I paste it here.

    Thank you.

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    Let's create a merge request, now that patches are no longer tested.
    Also, since GitLab CI is enabled for every project, GitLab CI itself reports any PHP_CodeSniffer error/warning.

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Pipeline finished with Success
    4 months ago
    Total: 3409s
    #260229
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi,

    I fixed phpcs issues that was reported by the GitLab CI as much as I can.

  • Pipeline finished with Success
    4 months ago
    Total: 3063s
    #260339
  • Assigned to divyansh.gupta
  • šŸ‡®šŸ‡³India divyansh.gupta Jaipur

    Working on it.

  • šŸ‡®šŸ‡³India divyansh.gupta Jaipur

    Please review.

  • Pipeline finished with Success
    21 days ago
    Total: 3014s
    #356261
  • šŸ‡®šŸ‡³India chandansha

    I have tested MR 6 using @cleavinjosh command given by #5 and there is still some error is pending.
    I move it to Need Work.
    Thanks!

  • šŸ‡®šŸ‡³India divyansh.gupta Jaipur

    Hello @chandansha
    MR-6 is working fine without any merge conflicts and neither the gitlab-ci pipeline is showing any PHP_CodeSniffer error that's what this issue was asking for.

  • šŸ‡®šŸ‡³India chandansha

    @divyansh.gupta sorry I have tested it on my local phpcs. In Pipeline are run successfully passed.
    I move it to RTBC
    Thanks!!

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    There are files in the merge requests which are probably created by the IDE, but which should not have been committed. A review should have reported those files, and the issue should have been marked as Needs work.

  • šŸ‡®šŸ‡³India divyansh.gupta Jaipur

    Hello @avpaderno,
    Made the changes you asked me to do in the MR.
    Please review.

  • Pipeline finished with Success
    7 days ago
    Total: 3686s
    #369503
Production build 0.71.5 2024