Running phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig for the module shows the following issues that should be fixed.
FILE: ./duet_date_picker.info.yml
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
FILE: ./ci/templates/release.package.yml
90 | ERROR | [x] Expected 1 newline at end of file; 2 found
FILE: ./config/schema/duet_date_picker.schema.yml
14 | ERROR | [x] Expected 1 newline at end of file; 2 found
FILE: ./duet_date_picker.module
1 | ERROR | [x] Missing file doc comment
FILE: ./src/Plugin/Field/FieldWidget/DuetDatePickerWidget.php
53 | ERROR | [x] No space found before comment text; expected "// $element[$date_picker_element_name] = $element['value'];" but
| | found "//$element[$date_picker_element_name] = $element['value'];"
75 | ERROR | [ ] The array declaration extends to column 95 (the limit is 80). The array content should be split up over
| | multiple lines
85 | WARNING | [ ] Only string literals should be passed to t() where possible
181 | WARNING | [ ] Only string literals should be passed to t() where possible
FILE: ./src/Plugin/Field/FieldWidget/DuetDateRangePickerWidget.php
70 | ERROR | The array declaration extends to column 101 (the limit is 80). The array content should be split up over multiple
| | lines
71 | ERROR | The array declaration extends to column 99 (the limit is 80). The array content should be split up over multiple
| | lines
106 | WARNING | Only string literals should be passed to t() where possible
112 | WARNING | Only string literals should be passed to t() where possible
216 | WARNING | Only string literals should be passed to t() where possible
222 | WARNING | Only string literals should be passed to t() where possible
FILE: ./src/Plugin/Validation/Constraint/NoPastDatesConstraintValidator.php
18 | WARNING | Unused variable $delta.
38 | ERROR | Parameter tags must be grouped together in a doc comment
FILE: ./src/Plugin/Validation/Constraint/NoPastDatesConstraint.php
18 | ERROR | Missing short description in doc comment
FILE: ./README.md
6 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
29 | WARNING | [ ] Line exceeds 80 characters; contains 353 characters
31 | ERROR | [x] Expected 1 newline at end of file; 2 found
Comments
Comment #2
dineshkumarbollu commentedComment #3
avpadernoComment #4
paraderojether commentedHi @dineshkumarbollu
I reviewed patch #2 and there are still remaining phpcs warnings shown below.
FILE: /Users/studenttrainees/Drupal2/drupalsite/docroot/modules/duet_date_picker/duet_date_picker.info.yml
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-------------------------------------------------------------------------------------------------------------
FILE: ...rupal2/drupalsite/docroot/modules/duet_date_picker/src/Plugin/Validation/Constraint/NoPastDatesConstraintValidator.php
----------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------
18 | WARNING | Unused variable $delta.
----------------------------------------------------------------------------------------------------------------------------
Please check.
Thank You.
Comment #5
chanderbhushan commentedAdded patch for fix
Comment #6
chanderbhushan commentedComment #7
avpadernoJust adding a
@filetag is not sufficient. The short description is still missing.The last patch is not even complete, since it does not fix all the issues the report listed.
Comment #8
avpadernoFurthermore, if I run the command shown in the issue summary, I get a different report. Those are the issues to be fixed for the 1.0.x branch.
Comment #9
sakthi_dev commentedCreated a patch for resolving the PHPCS issue as mentioned in #8. Please review.
Issues on running phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig even after applying patch.
Comment #10
avpadernoThe short description for the module is Hook implementations for the Duet Date Picker module.
Module is only used when it is the first word in a sentence; otherwise, it is module.
Coding standards do not say that lines must be shorter than 81 characters, That is an example of line that is better to be left as it is.
That code does not translate the label. That is one of the case where either
$this->getSetting('label')is passed to$this->t()or$this->t()is not used.Comment #11
mrinalini9 commentedUpdated patch #9 by addressing #10, please review it.
Thanks!
Comment #12
bindu r commentedHi,Reviewed the patch provided at #11 , it could not be applied. Attaching the screenshot for reference.
Thanks!
Comment #15
a.aaronjake commentedHi @mrinalini9,
Applied the patch you provided, the patch was applied not-so successfully, might be the reason it resulted to the reported errors. Please see below:
Kindly check
Thanks,
Jake
Comment #17
minoroffense commentedThanks for the work. I finish it up and set the attribution in the commit for everyone.