- Issue created by @taraskorpach
- Issue was unassigned.
- Status changed to Needs review
12 months ago 10:37am 28 December 2023 - šŗš¦Ukraine taraskorpach Lutsk šŗš¦
I've created a MR.
FYI, I've added a phpcs.xml file to exclude warnings from the
Drupal.Semantics.FunctionT.NotLiteralString
rule.
If you have any suggestions for appropriately fixing these warnings, please do not hesitate to share them.The issue needs review.
- Status changed to Needs work
12 months ago 5:04am 29 December 2023 - šµšPhilippines clarkssquared
Hi
I applied the MR !6 and it fixes most of the PHPCS issues but there is still a PHPCS errors
ā date_range_formatter git:(9.0.x) curl https://git.drupalcode.org/project/date_range_formatter/-/merge_requests/6.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 7372 0 7372 0 0 14690 0 --:--:-- --:--:-- --:--:-- 14892 patching file date_range_formatter.install patching file date_range_formatter.module patching file phpcs.xml patching file 'src/Plugin/Field/FieldFormatter/DateRangeFormatterRangeFormatter.php' ā date_range_formatter git:(9.0.x) ā .. ā contrib git:(master) ā phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml date_range_formatter FILE: /Users/clarksubing-subing/Projects/d9/d9-local/web/modules/contrib/date_range_formatter/date_range_formatter.info.yml --------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE --------------------------------------------------------------------------------------------------------------------------- 7 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:" --------------------------------------------------------------------------------------------------------------------------- FILE: ...ubing-subing/Projects/d9/d9-local/web/modules/contrib/date_range_formatter/src/Plugin/Field/FieldFormatter/DateRangeFormatterRangeFormatter.php ----------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES ----------------------------------------------------------------------------------------------------------------------------------------------------- 70 | WARNING | Only string literals should be passed to t() where possible 84 | WARNING | Only string literals should be passed to t() where possible ----------------------------------------------------------------------------------------------------------------------------------------------------- Time: 272ms; Memory: 10MB ā contrib git:(master) ā
- Status changed to Needs review
12 months ago 10:57am 29 December 2023 - šŗš¦Ukraine taraskorpach Lutsk šŗš¦
I've fixed the module dependency warning and updated the MR.
Regarding the translation warnings I mentioned above, I've added a phpcs.xml file. This means you need to run the phpcs command directly in the module folder to allow phpcs to take into account all the provided exclusions.
- Status changed to Needs work
12 months ago 9:13am 31 December 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 has been used, which arguments have been used, and which report that command shown.
- Assigned to nitin_lama
- Issue was unassigned.
- Status changed to Needs review
12 months ago 6:28am 2 January 2024 - šŗš¦Ukraine taraskorpach Lutsk šŗš¦
I don't believe that removing translation functions is the best approach here. Someone may already have translated some strings on their sites, and removing these functions could probably cause some issues. This issue requires further consideration.
BTW, I'm currently running the PHPCS command in the project folder, and it isn't showing any issues. Could someone else try running the command?
- šŗš¦Ukraine taraskorpach Lutsk šŗš¦
I am modifying some arguments in the PHPCS command to utilize the appropriate phpcs.xml file during command execution.
Another method to bypass these errors is to use the ignore command, as in
Drupal.Semantics.FunctionT.NotLiteralString.
However, creating a phpcs.xml file seems like a more suitable approach in this context.
- š®š¹Italy apaderno Brescia, š®š¹
$this->t()
is not the correct way to translate configuration object values. For that, there is a specific API that needs to be used, which is also documented on drupal.org. - šŗš¦Ukraine taraskorpach Lutsk šŗš¦
Yeah, but these settings are part of a formatter field form.
As far as I know, we are unable to translate them because the issue š Entity view/form mode formatter/widget settings have no translation UI Needs review is still in progress.
- š®š¹Italy apaderno Brescia, š®š¹
If that is the only way to get translated strings in that specific context, I would leave the code as it is. I think it is more important to get translated strings than a PHP_CodeSniffer report without errors/warnings.
Once š Entity view/form mode formatter/widget settings have no translation UI Needs review get fixed, the code can be changed. - šŗš¦Ukraine taraskorpach Lutsk šŗš¦
Absolutely. Because of that, I've just added a sniffer rule to avoid unnecessary warnings. We just need a review rn.
- Status changed to Needs work
11 months ago 4:52pm 22 January 2024 - š·šŗRussia zniki.ru
Thanks for MR, please check my feedback.
There are more changes in the MR, then we have in the phpcs report in the issue.
I don't want to fix issues that is reported by phpcs in this issue.
Can you please update report in the IS? - Assigned to taraskorpach
- Status changed to Active
11 months ago 4:55pm 22 January 2024 - šŗš¦Ukraine taraskorpach Lutsk šŗš¦
I'll update the MR according to your feedback. Thanks
- Issue was unassigned.
- Status changed to Needs review
11 months ago 5:46pm 22 January 2024 - šŗš¦Ukraine taraskorpach Lutsk šŗš¦
All threads seem to have been resolved. @nikolay-shapovalov, could you take a look at this?
- Status changed to Needs work
11 months ago 9:32pm 22 January 2024 - š·šŗRussia zniki.ru
Taras, thanks a lot, changes looks good. Please check my question.
Can you please update IS, and provide fresh phpcs report?
- Assigned to taraskorpach
- Status changed to Active
11 months ago 9:51pm 22 January 2024 - Issue was unassigned.
- Status changed to Needs review
11 months ago 7:24pm 23 January 2024 - šŗš¦Ukraine taraskorpach Lutsk šŗš¦
I'm returning the entire PHPCS log to the IS as @nikolay-shapovalov has mentioned above.
Btw, the .module file has been removed.
- šŗš¦Ukraine taraskorpach Lutsk šŗš¦
Removing the PATCHES.txt file from the log
- Status changed to RTBC
11 months ago 9:36pm 23 January 2024