Running phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig shows the following errors/warnings which should be fixed.
FILE: ./src/Controller/CoreModeller.php
----------------------------------------------------------------------
FOUND 21 ERRORS AFFECTING 20 LINES
----------------------------------------------------------------------
55 | ERROR | [ ] Parameter $condition_manager is not described in
| | comment
62 | ERROR | [ ] Doc comment for parameter $condition does not
| | match actual variable name $form_builder
62 | ERROR | [x] Parameter comment must be on the next line
107 | ERROR | [x] Missing function doc comment
124 | ERROR | [x] A unary operator statement must not be followed by
| | a space
136 | ERROR | [x] Missing function doc comment
150 | ERROR | [x] Newline required after opening brace
155 | ERROR | [x] Missing function doc comment
169 | ERROR | [x] Newline required after opening brace
174 | ERROR | [x] Missing function doc comment
191 | ERROR | [x] A unary operator statement must not be followed by
| | a space
203 | ERROR | [x] Missing function doc comment
217 | ERROR | [x] Newline required after opening brace
222 | ERROR | [x] Missing function doc comment
236 | ERROR | [x] Newline required after opening brace
241 | ERROR | [x] Missing function doc comment
258 | ERROR | [x] A unary operator statement must not be followed by
| | a space
270 | ERROR | [x] Missing function doc comment
284 | ERROR | [x] Newline required after opening brace
289 | ERROR | [x] Missing function doc comment
303 | ERROR | [x] Newline required after opening brace
----------------------------------------------------------------------
PHPCBF CAN FIX THE 19 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ./src/Form/EcaForm.php
----------------------------------------------------------------------
FOUND 5 ERRORS AND 1 WARNING AFFECTING 6 LINES
----------------------------------------------------------------------
955 | WARNING | [ ] Avoid backslash escaping in translatable strings
| | when possible, use '' quotes instead
958 | ERROR | [x] Array indentation error, expected 12 spaces but
| | found 14
959 | ERROR | [x] Array indentation error, expected 12 spaces but
| | found 14
960 | ERROR | [x] Array closing indentation error, expected 10
| | spaces but found 12
961 | ERROR | [x] Array closing indentation error, expected 8
| | spaces but found 10
962 | ERROR | [x] Line indented incorrectly; expected 8 spaces,
| | found 10
----------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ./src/Form/EcaPluginDeleteForm.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
82 | WARNING | Avoid backslash escaping in translatable strings when
| | possible, use "" quotes instead
----------------------------------------------------------------------
FILE: ./src/Form/EcaPluginForm.php
----------------------------------------------------------------------
FOUND 5 ERRORS AND 2 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------
177 | ERROR | [ ] Doc comment for parameter $token_browser does
| | not match actual variable name $config_array
179 | ERROR | [ ] Doc comment for parameter $module_handler does
| | not match actual variable name $config_array
260 | WARNING | [ ] Avoid backslash escaping in translatable
| | strings when possible, use "" quotes instead
466 | ERROR | [ ] Concatenating translatable strings is not
| | allowed, use placeholders instead and only one
| | string literal
607 | WARNING | [ ] Avoid backslash escaping in translatable
| | strings when possible, use "" quotes instead
1040 | ERROR | [x] Missing function doc comment
1048 | ERROR | [x] Missing function doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
Time: 341ms; Memory: 18MB
Comments
Comment #2
Harsh panchal commentedI have fixed Drupal standard coding issue and providing a patch.
Comment #3
dharti patel commentedComment #4
dharti patel commentedI've reviewed and applied the #2 patch but after applying the patch facing the below errors.
I have created a patch to fix the above issue.
Kindly review the patch.
Thanks!
Comment #5
mxh commentedPatch is not fulfilling Drupal coding standards. Also, added stuff like this one
is no descriptive comment, and therefore is less useful than having no comment. Added comments need to make sense and add helpful information.
Comment #6
juancec commentedHi, I just did an adjustment to #4 patch, so I'm providing an updated patch with all the PHPCS issues fixed.
Kindly review the patch and let me know your feedback =)
Comment #7
atul_ghate commentedHi,
i will review this patch.
Comment #8
atul_ghate commentedYour patch is applied cleanly and can be moved to RTBC.
/var/www/html/oslando/web $ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml --encoding=utf-8 -p modules/contrib/eca_cm/ --ignore=node_module
................ 16 / 16 (100%)
Time: 1.24 secs; Memory: 20MB
Comment #9
juancec commentedComment #10
mxh commentedFormatting is still not following Drupal coding standards.
Comment #11
nitin_lamaComment #12
nitin_lama@mxh, by formatting did you mean the function comments ? Because i see no pending CS issues in the module.
Comment #14
vishaljd commentedComment #16
vishaljd commentedComment #17
mxh commentedFormatting is still not following Drupal coding standards.
Comment #18
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 #21
elberHi I fixed the phpcs errors please revise.
Comment #22
mxh commentedNo, see #17 and #18.
Comment #23
elberHi I ran the follow commands
phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,ymlphpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,ymlafter that I made the changes I didn't see phpcs errors anymore, @mxh could you please show me which the errors you are seeing?Comment #24
avpaderno@elber See the previous comments. The issue summary is not even reporting which
phpcscoding standards have been used.Comment #25
elberHi I saw the previous comments and I didn't understand what is wrong with this issue because phpcs errors has been already fixed, please can you tell me what is wrong?
Comment #26
mxh commentedBy looking into the suggested merge request (which already takes time BTW), I can immedtiately see that your changes are not following Drupal coding standards. I don't take the time to tell what exactly is wrong. I can assure you that the code changes in the merge request is wrong regards Drupal coding standards. Read the guidelines of Drupal coding standards, understand them, look at your suggested merge request and then you'll see what's wrong.
Comment #27
elberHi I ran drupal phpcs commands to check phpcs erros as I said in the comment #23 and I didn't have erros in output, when you find the phpcs errors you can let me know it wil be a pleasure keeping working in this issue, thank you!
Comment #28
indrapatil commentedComment #29
avpadernoComment #30
mahima_mathur23 commentedComment #31
Shreyas gowda commentedComment #32
avpadernoComment #33
bindu r commentedComment #34
avpadernoSince a MR has been provided, it would be better to keep using that MR.
Comment #35
nisha_j commentedComment #36
zkhan.aamir commentedHi,
The patch #35 applied succesfully.
But still there are some errors
Comment #37
sakthi_dev commentedLeaving 314 as it is because it is a if clause. Please review.
Comment #38
avpadernoFunction/method declarations are written on a single line. There is no need to add a comment to describe what change has been introduced.
That comment is not necessary and must be removed.
That method is not inherited from the parent class. Its documentation comment must be different.
An empty loop can be simply be removed.
Since an issue fork has been created, let's continue to use it.
Comment #39
sakthi_dev commentedAddressed the comment #38. Please review.
Comment #40
nisha_j commentedHi, The changes suggested in comment #38 has been incorporated in the patch #39.
Thankyou.
Comment #41
avpadernoSince a issue fork has been already created, let's keep using it.
Comment #42
avpadernoComment #44
avpadernoComment #45
zkhan.aamir commentedHi,
MR #43 applied successfully.
There are still some errors
Comment #47
pray_12 commentedHi,
The errors and warnings from #45 have been successfully addressed;
however, there are still some remaining errors and warnings that need attention.
Comment #48
avpadernoGiven that the code in the EcaPluginForm.php file is the following one and that control structure conditions should not be wrapped into multiple lines, it is not possible to change it.
Comment #49
silvi.addweb commentedHello,
I applied the patch provided in !7 for the version 1.0.x-dev, the patch applied successfully.