- Issue created by @sonam_sharma
- Status changed to Needs work
over 1 year ago 11:35am 27 June 2023 - 🇱🇹Lithuania mindaugasd
1. Patch contains incorrect line, which would introduce bug
[ ] Expected type hint "string"; found "array" for $include_files
The docblock has incorrect info which should be changed instead
@param string $include_files
2. Another line which might be incorrect, and might introduce bug as well
[ ] Expected type hint "SplFileInfo"; found "\SplFileInfo" for $file
I will change patch, test and commit at some point.
- 🇮🇳India sonam_sharma
hello,
I have fixed
1. Patch contains incorrect line, which would introduce bug[ ] Expected type hint "string"; found "array" for $include_files
The docblock has incorrect info which should be changed instead
@param string $include_files
- Status changed to Needs review
over 1 year ago 12:01pm 27 June 2023 - Status changed to Needs work
over 1 year ago 12:04pm 27 June 2023 - thakurnishant_06 India
Hello @sonam_sharma,
Applied your patch . Still many coding standard issues needs to be fixed.FILE: /opt/lampp/htdocs/commerce_addons/web/modules/contrib/aidev/PATCHES.txt ----------------------------------------------------------------------------- FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES ----------------------------------------------------------------------------- 1 | WARNING | [ ] Line exceeds 80 characters; contains 104 characters 5 | ERROR | [x] Expected 1 newline at end of file; 3 found ----------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ----------------------------------------------------------------------------- FILE: /opt/lampp/htdocs/commerce_addons/web/modules/contrib/aidev/src/Source.php ---------------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ---------------------------------------------------------------------------------------------------------------------------------------- 7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\aidev\Exception\InvalidProjectException. ---------------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ---------------------------------------------------------------------------------------------------------------------------------------- FILE: /opt/lampp/htdocs/commerce_addons/web/modules/contrib/aidev/README.md --------------------------------------------------------------------------- FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES --------------------------------------------------------------------------- 33 | WARNING | Line exceeds 80 characters; contains 165 characters 39 | WARNING | Line exceeds 80 characters; contains 88 characters 40 | WARNING | Line exceeds 80 characters; contains 117 characters 41 | WARNING | Line exceeds 80 characters; contains 118 characters 43 | WARNING | Line exceeds 80 characters; contains 106 characters 46 | WARNING | Line exceeds 80 characters; contains 102 characters --------------------------------------------------------------------------- FILE: /opt/lampp/htdocs/commerce_addons/web/modules/contrib/aidev/tests/src/Unit/SourceTest.php ----------------------------------------------------------------------------------------------- FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 5 LINES ----------------------------------------------------------------------------------------------- 30 | ERROR | [x] Missing function doc comment 38 | ERROR | [x] Expected 1 blank line after function; 2 found 52 | WARNING | [ ] Unused variable $source_code. 66 | WARNING | [ ] Unused variable $source_code. 69 | ERROR | [x] Expected 1 newline at end of file; 0 found ----------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY -----------------------------------------------------------------------------------------------
Thankyou.
- Status changed to Needs review
over 1 year ago 12:07pm 27 June 2023 - 🇮🇳India sonam_sharma
I have fixed both the remaining issues:-
1. Patch contains incorrect line, which would introduce bug[ ] Expected type hint "string"; found "array" for $include_files
The docblock has incorrect info which should be changed instead
@param string $include_files
2. Another line which might be incorrect, and might introduce bug as well
[ ] Expected type hint "SplFileInfo"; found "\SplFileInfo" for $file
please! review the patch - Status changed to Needs work
over 1 year ago 12:21pm 27 June 2023 - thakurnishant_06 India
Hello @sonam_sharma.
The patch was applied smoothly but still there are few issues left (addressed in #6). Moving it to needs work.
Adding screenshot for reference.
Thank You. - 🇱🇹Lithuania mindaugasd
Also why comments are split with a . (dot) or each line starts with Uppercase letter?
It breaks English grammar and readability.
Is that a coding standard, or a bug?
Since it is not consistent (once it starts with an upper letter, other times is not) then I think these comments are incorrect in the patch. - 🇮🇳India sonam_sharma
hello @ mindaugasd
I have removed dots & Uppercases from splitting lines - 🇮🇳India sonam_sharma
hello,
@thakurnishant_06
I have fixed remaining issues
please! review the new_phpcs_3370530.patch - Assigned to thakurnishant_06
- thakurnishant_06 India
Hello @sonam_sharma,
Tested new_phpcs_3370530.patch . Patch applied smoothly . Some errors are still there addressed in #8.I will work on this.
Thank you. - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 4:48am 28 June 2023 - thakurnishant_06 India
Adding a updated patch to fix all remaining warnings and errors (addressed in #8), related to Drupal coding standard.
Kindly review the patch.
Thank you for your support. - @sonam_sharma opened merge request.
- 🇱🇹Lithuania mindaugasd
@sonam_sharma your merge request is empty, has no changes
- Status changed to Needs work
over 1 year ago 11:49am 29 June 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
+/** + * @file + * Contains the AI developer assistant module. + */
The usual description is Hook implementations for the [module name] module. where [module name] is the module name shown in the .info.yml file.
+/** + * Represents an exception for invalid projects. + * + * @package Drupal\aidev + */ class InvalidProjectException extends \Exception {
Class descriptions must not start with Represent/Represents. Exception thrown when […]. is a better description.
- // If the current file is a regular file, read its contents and store them in the associative array. + // If the current file is a regular file, read its contents and + // store them in the associative array.
It is file content, not file contents. This means the phrase must be read its content and store it in an array.
+ else { + // Check if $exclusion appears in the file path and is a separate path + // (i.e., right after a path separator, before a separator, or both). + // If it does, return TRUE. if (preg_match('~(^|/)' . preg_quote($exclusion, '~') . '(/|$)~', $file_path)) { return TRUE; }
I would remove If it does, return TRUE. as that part of the code does not need explanations.
+ /** + * Sets up the test environment. + * + * @return void + * Nothing is returned by this method. + */ protected function setUp(): void {
Since that is an inherited method, its documentation comment just needs to contain
@{inheritdoc}
. - Assigned to Anjali Mehta
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 12:37pm 29 June 2023 - 🇮🇳India Anjali Mehta
Hello Everyone,
Created a patch to update the changes addressed in #16.
Kindly review the patch.
Thank you for support. - Status changed to RTBC
over 1 year ago 5:06am 1 July 2023 - thakurnishant_06 India
Hello @Anjali Mehta,
Tested your patch . Patch applied smoothly . Patch updated all the changes addressed in #16.
can be moved to RTBC.
Thank you for your support. - Status changed to Needs work
over 1 year ago 8:24am 1 July 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
Patches need to include all the changes, not just the changes required in the last review.
The other patches size is between 5 KB and 6 KB. The last patch size is just 2.01 KB. - Assigned to Prachi6824
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 10:33am 1 July 2023 - 🇮🇳India Prachi6824
Hello,
I have created a patch to solve all the errors related to phpcs code standard issues .
Also, for the phpcs Drupal practice issues.FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------------
54 | WARNING | Unused variable $source_code.
68 | WARNING | Unused variable $source_code.
---------------------------------------------------------------------------------Please review my patch and apply it .
Thank You. - Status changed to Closed: won't fix
over 1 year ago 10:39am 23 August 2023 - 🇱🇹Lithuania mindaugasd
I am not commiting, because:
- https://www.drupal.org/drupalorg/docs/marketplace/abuse-of-the-contribut... →
- Codebase is going to be overridden by next version of the module soon
Thank you @apaderno for reviewing patches.