- Issue created by @sonam_sharma
- Status changed to Needs work
over 1 year ago 11:12pm 26 June 2023 - 🇵ðŸ‡Philippines paraderojether
Hi I reviewed patch #2, and there are still remaining issues reported by phpcs shown below:
FILE: /Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/date_range_picker/css/date_range_picker.css -------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE -------------------------------------------------------------------------------------------------------------------------- 4 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4 -------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------------------------------------------------- FILE: ...drupalorg-site/docroot/modules/contrib/date_range_picker/src/Plugin/Field/FieldWidget/DateRangePickerFieldWidget.php -------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE -------------------------------------------------------------------------------------------------------------------------- 33 | ERROR | The array declaration extends to column 100 (the limit is 80). The array content should be split up over | | multiple lines -------------------------------------------------------------------------------------------------------------------------- Time: 299ms; Memory: 10MB
Please check.
Thank You. - Status changed to Needs review
over 1 year ago 6:25am 27 June 2023 I have fixed remaining issues,
please retest the patch @paraderojether- Issue was unassigned.
- Status changed to Needs work
over 1 year ago 8:50am 3 July 2023 - 🇮🇹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 review
over 1 year ago 12:28pm 10 July 2023 - 🇮🇳India Ashutosh Ahirwal India
I have updated all the issue summary with all the warnings/errors generated by phpcs.
- Status changed to Needs work
over 1 year ago 2:34pm 10 July 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
In JavaScript
true
,false
, andnull
are used. PHP_CodeSniffer is applying PHP rules to JavaScript files. It is sufficient to runphpcs --standard=Drupal,DrupalPractice -s --extensions=js
to notice that.----------------------------------------------------------------------------------------------------------------------------------- FOUND 12 ERRORS AFFECTING 11 LINES ----------------------------------------------------------------------------------------------------------------------------------- 10 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null" | | (Generic.PHP.UpperCaseConstant.Found) 11 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null" | | (Generic.PHP.UpperCaseConstant.Found) 28 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null" | | (Generic.PHP.UpperCaseConstant.Found) 28 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null" | | (Generic.PHP.UpperCaseConstant.Found) 37 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null" | | (Generic.PHP.UpperCaseConstant.Found) 45 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null" | | (Generic.PHP.UpperCaseConstant.Found) 46 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null" | | (Generic.PHP.UpperCaseConstant.Found) 47 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null" | | (Generic.PHP.UpperCaseConstant.Found) 48 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null" | | (Generic.PHP.UpperCaseConstant.Found) 55 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false" | | (Generic.PHP.UpperCaseConstant.Found) 68 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null" | | (Generic.PHP.UpperCaseConstant.Found) 99 | ERROR | [x] Expected 1 newline at end of file; 0 found (Drupal.Files.EndFileNewline.NoneFound) ----------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY -----------------------------------------------------------------------------------------------------------------------------------
Generic.PHP.UpperCaseConstant.Found
is a rule for PHP, not for JavaScript. - Status changed to Needs review
over 1 year ago 6:32am 11 July 2023 - 🇮🇳India mrinalini9 New Delhi
Updated patch #4 by addressing #7, please review it.
Thanks & Regards,
Mrinalini - Status changed to RTBC
over 1 year ago 7:15am 12 July 2023 - 🇵ðŸ‡Philippines paraderojether
I reviewed patch #10, applied it against Date range picker 8.x-1.x-dev, and confirmed it fixes all the issues reported by phpcs.
I added screenshots for reference.
Thank You. - Status changed to Needs work
over 1 year ago 9:11am 12 July 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
- var startDate = null; - var endDate = null; + var startDate = NULL; + var endDate = NULL;
- allowRepick: false, + allowRepick: FALSE,
See my previous comment and the report in the issue summary.
NULL
,TRUE
, andFALSE
are not used in JavaScript, where those predefined values are written in lower-case characters.- $uniqueString = implode('-', array_merge($element['#field_parents'], [$items->getName(), $delta])); + $uniqueString = implode('-', array_merge($element['#field_parents'], + [$items->getName(), $delta]));
Code lines are allowed to exceed 80 characters, if they are easier to understand. With the changed code is harder to understand that
[$items->getName(), $delta]
is an argument forarray_merge()
. - Assigned to sourabhjain
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 11:12am 12 July 2023 - 🇮🇳India sourabhjain
Updated the changes suggested in #12. Please review.
- Status changed to Needs work
over 1 year ago 9:41am 13 July 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
- if (startDate === null && endDate === null) { + if (startDate === NULL && endDate === NULL) {
JavaScript code needs to use
true
,false
, andnull
, written exactly like that.
Please see the issue summary: It is not about changing JavaScript files, since PHP_CodeSniffer suggests the wrong changes for those files. - Status changed to Needs review
over 1 year ago 10:09am 13 July 2023 - 🇮🇳India mrinalini9 New Delhi
Updated patch #14 by addressing #15, please review it.
Thanks!
- Status changed to RTBC
over 1 year ago 10:23am 13 July 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
The last patch correctly changes the files, without touching any JavaScript file.
- Status changed to Closed: won't fix
over 1 year ago 9:43am 22 July 2023 - 🇩🇪Germany k4v
Hey, I'm doing this in my free time, if you like to fix such minor nitpicks I can add you as a co maintainer.