Resolve all the warnings outputted in the following page.
https://pareview.sh/pareview/https-git.drupal.org-project-cloud.git

CommentFileSizeAuthor
#34 warning_unused_use_statement-3014131-34.patch9.79 KBshidat
#33 error_inline_comment_must_end-3014131-33.patch51.72 KBshidat
#23 warning_unused_variable-3014131_23.patch8.22 KBshidat
#22 error_inline_comment_must_end-3014131_22.patch51.92 KBshidat
#21 error_comments_not_appear-3014131_21.patch3.93 KBshidat
#20 error_case_breaking-3014131_20.patch7.39 KBshidat
#19 except_php_files-3014131_19.patch96.36 KBshidat
#18 error_missing_function_doc-3014131_18.patch14.92 KBshidat
#17 error_closing_parenthesis_of_array_3014131_17.patch3.78 KBshidat
#17 error_inline_comment_must_end_3014131_16.patch50.27 KBshidat
#16 error_closing_parenthesis_of_array_3014131_16.patch3.78 KBshidat
#12 3014131_error_inline_comment_must_end.patch50.27 KBshidat
#11 3014131_error_comments_not_appear.patch3.99 KBshidat
#10 3014131_warning_no_white_space_after.patch2.98 KBshidat
#9 3014131_error_case_breaking.patch11.19 KBshidat
#6 3014131_warning_unused_variable.patch5.62 KBshidat
#5 3014131_warning_unused_use_statement.patch10.22 KBshidat
#4 3014131_warning_unused_use_statement.patch10.22 KBshidat
#3 3014131_except_php_files.patch132.35 KBshidat
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Xiaohua Guan created an issue. See original summary.

Xiaohua Guan’s picture

Issue summary: View changes
shidat’s picture

Add the patch for suppress warning.
The patch file 3014131_except_php_files.patch resolve the notices about the files except PHP files.

shidat’s picture

To avoid "Case breaking statements must be followed by a single blank line" errors.

shidat’s picture

Remove unused "use statement"

shidat’s picture

Remove unused variables.

yas’s picture

Status: Active » Needs review

@shidat

Thank you for the patches.

  1. The patches in between comment #4 and #5 are identical? (3014131_warning_unused_use_statement.patch)
  2. I'm concerned 3014131_except_php_files.patchto delete JS file(s) such as cloud.auto_refresh_list_all_instances.js as future reference.
  3. I'm not confident whether the following change is really valid or not in the patch 3014131_warning_unused_variable.patch.

    Original:
    foreach (array_column($results['AvailabilityZones'], 'ZoneName') as $key => $availability_zone) {
      $zones[$availability_zone] = $availability_zone;
    }
    

    Patch:

    foreach (array_column($results['AvailabilityZones'], 'ZoneName') as $availability_zone) {
      $zones[$availability_zone] = $availability_zone;
    }
    

    It would be appreciated if you can write the test code for it.

@baldwinlouie

Could you please confirm about the patches?

Xiaohua Guan’s picture

shidat’s picture

1. The patches in between comment #4 and #5 are identical?

oops, It is my mistake. duplicate.
guan-san upload correct patch file.

2. I'm concerned 3014131_except_php_files.patchto delete JS file(s) ...

OK, I'll resume the JS.

3. I'm not confident whether the following change is really valid or not ...

In this code, there is no appearance $key in loop block. So, no need to store the loop index at $key variable, I think.

shidat’s picture

There should be no white space after an opening “{”

shidat’s picture

Comments may not appear after statements

shidat’s picture

Inline comments must end in full-stops, exclamation | | marks, colons, question marks, or closing parentheses

Xiaohua Guan’s picture

yas’s picture

@shidat

Thank you for more patches.

My comments are here (I put the patch name in each item.)

  1. 3014131_warning_unused_use_statement.patch: The patches in between comment #4 and #5 are identical?

    → OK, it looks good to me.

  2. 3014131_except_php_files.patch: I'm concerned to delete JS file(s) such as cloud.auto_refresh_list_all_instances.js as future reference.

    → I mean that we should leave the one(s) as it is? (I want to get @baldwinlouie's feedback

  3. 3014131_warning_unused_variable.patch: I'm not confident whether the following change is really valid or not in the patch.

    → I understand that waning by the tool, however I meant that I wanted you to make sure if it makes the same result in the following code since it is different in PHP between foreach ($array as $variable) and foreach ($array as $key => $value) even though $key is not used later. It would be appreciated if you can write the test code for it.

  4. 3014131_error_case_breaking.patch: Looks fine to me but aws_cloud.tokens.inc can be deleted in this patch??
  5. 3014131_warning_no_white_space_after.patch: This is fine to me.
  6. 3014131_error_comments_not_appear.patch: //12 digits// 12 digits. Also, I think // @TODO comment line can be deleted (Need to get @baldwinlouie's feedback)
  7. 3014131_error_inline_comment_must_end.patch: Let's start an UPPER case at the beginning of the comment; put one space after //. Please put a period (.) in a header like // Updated YYYY/mm/dd <username>

By the way, FYI I think the patch name should be [description]-[issue-number]-[comment-number].patch .

yas’s picture

Assigned: Unassigned » shidat
shidat’s picture

ERROR | Inline comments must end in full-stops, exclamation | | marks, colons, question marks, or closing parentheses

Sorry, I mistake the uploaded patch. Correct one is attach on #17

shidat’s picture

ERROR | Closing parenthesis of array declaration must be on a new line

shidat’s picture

ERROR | Missing function doc comment

shidat’s picture

Apply comment #14

3014131_except_php_files.patch: I'm concerned to delete JS file(s) such as cloud.auto_refresh_list_all_instances.js as future reference.
→ I mean that we should leave the one(s) as it is? (I want to get @baldwinlouie's feedback

shidat’s picture

Previous patch name is "3014131_error_case_breaking.patch"

Apply the comment.

3014131_error_case_breaking.patch: Looks fine to me but aws_cloud.tokens.inc can be deleted in this patch??

shidat’s picture

Previous patch name is "3014131_error_comments_not_appear.patch"

Apply comment.

3014131_error_comments_not_appear.patch: //12 digits→// 12 digits. Also, I think // @TODO comment line can be deleted (Need to get @baldwinlouie's feedback)

shidat’s picture

3014131_error_inline_comment_must_end.patch: Let's start an UPPER case at the beginning of the comment; put one space after //. Please put a period (.) in a header like // Updated YYYY/mm/dd

shidat’s picture

Add unit test case for the modification.

3014131_warning_unused_variable.patch: I'm not confident whether the following change is really valid or not in the patch.
→ I understand that waning by the tool, however I meant that I wanted you to make sure if it makes the same result in the following code since it is different in PHP between foreach ($array as $variable) and foreach ($array as $key => $value) even though $key is not used later. It would be appreciated if you can write the test code for it.

yas’s picture

yas’s picture

Status: Needs work » Reviewed & tested by the community

@shidat
@xiaohua-guan

We reviewed the patches. I'll merge the ones. Thank you for your contributions.

  • yas committed 3a85894 on 8.x-1.x authored by shidat
    Issue #3014131 by shidat, yas, Xiaohua Guan: Comply with Drupal code...

  • yas committed cf4da29 on 8.x-1.x authored by shidat
    Issue #3014131 by shidat, yas, Xiaohua Guan: Comply with Drupal code...

  • yas committed c47237e on 8.x-1.x authored by shidat
    Issue #3014131 by shidat, yas, Xiaohua Guan: Comply with Drupal code...

  • yas committed a24364e on 8.x-1.x authored by shidat
    Issue #3014131 by shidat, yas, Xiaohua Guan: Comply with Drupal code...

  • yas committed 7ae3dd4 on 8.x-1.x authored by shidat
    Issue #3014131 by shidat, yas, Xiaohua Guan: Comply with Drupal code...

  • yas committed b43f41f on 8.x-1.x authored by shidat
    Issue #3014131 by shidat, yas, Xiaohua Guan: Comply with Drupal code...
yas’s picture

Status: Reviewed & tested by the community » Needs work

@shidat

After I applied the following patches successfully, I couldn't apply error_inline_comment_must_end-3014131_22.patch and 3014131_warning_unused_use_statement.patch.

  • error_closing_parenthesis_of_array_3014131_17.patch
  • error_missing_function_doc-3014131_18.patch
  • except_php_files-3014131_19.patch
  • error_case_breaking-3014131_20.patch
  • error_comments_not_appear-3014131_21.patch
  • warning_unused_variable-3014131_23.patch

Could you please make it work again?

shidat’s picture

I modified the patch files. They can be applied now. Please try the new patch files.

shidat’s picture

> I couldn't apply error_inline_comment_must_end-3014131_22.patch and 3014131_warning_unused_use_statement.patch.

Xiaohua Guan’s picture

Status: Needs work » Needs review

The last submitted patch, 33: error_inline_comment_must_end-3014131-33.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

yas’s picture

Status: Needs review » Reviewed & tested by the community

@shidat
@xiaohua-guan

I reviewed the patches and looks fine. Thank you for your fixes. I'll merge the following ones.

  • error_inline_comment_must_end-3014131-33.patch and
  • warning_unused_use_statement-3014131-34.patch

  • yas committed aca910d on 8.x-1.x authored by shidat
    Issue #3014131 by shidat, yas, Xiaohua Guan: Comply with Drupal code...

  • yas committed 97f9db9 on 8.x-1.x authored by shidat
    Issue #3014131 by shidat, yas, Xiaohua Guan: Comply with Drupal code...
yas’s picture

Please let us close this issue once. Let's create another issue for further fixes.

yas’s picture

Status: Reviewed & tested by the community » Fixed
yas’s picture

Title: Comply with Drupal code standard » Comply with Drupal coding standard

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.