Problem/Motivation

The changes required for 'Drupal.Commenting.DocComment.ShortSingleLine' are too large and need to be split into child issues.

Proposed resolution

Fix class doc block in tests for the sniff 'Drupal.Commenting.DocComment.ShortSingleLine'.

Remaining tasks

Patch
Review - Instructions for adding the sniff and running the test are in the Issue Summary of #3123060: Enable 'Drupal.Commenting.DocComment.ShortSingleLine' coding standard
Commit

Adding the followups that have been made.

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3268809

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

quietone created an issue. See original summary.

quietone’s picture

StatusFileSize
new65.7 KB
quietone’s picture

Issue tags: +Coding standards
quietone’s picture

Title: Fix class comment doc blocks for 'Drupal.Commenting.DocComment.ShortSingleLine' » Fix class comment doc blocks in tests for 'Drupal.Commenting.DocComment.ShortSingleLine'
quietone’s picture

Status: Active » Needs review
quietone’s picture

StatusFileSize
new4.28 KB
new65.91 KB

Update the patch with a simplified drupalci.yml.

quietone’s picture

The commit-code-checks passed, this is ready for review.

jatingupta40’s picture

Assigned: Unassigned » jatingupta40

I will review this #6 patch.

jatingupta40’s picture

Assigned: jatingupta40 » Unassigned
Status: Needs review » Needs work
StatusFileSize
new35.5 KB
new31.17 KB

@quietone I tried applying #6 patch but got 2 errors.

Checking patch core/modules/color/tests/src/Functional/ColorTest.php...
error: while searching for:
use Drupal\Tests\BrowserTestBase;

/**
 * Modify the Bartik theme colors and make sure the changes are reflected on the
 * frontend.
 *
 * @group color
 */

error: patch failed: core/modules/color/tests/src/Functional/ColorTest.php:5
error: core/modules/color/tests/src/Functional/ColorTest.php: patch does not apply

Checking patch core/modules/system/tests/src/Functional/System/ThemeTest.php...
Hunk #1 succeeded at 9 (offset 1 line).

Checking patch core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php...
error: while searching for:
use Drupal\KernelTests\KernelTestBase;

/**
 * Tests that core image manipulations work properly: scale, resize, rotate,
 * crop, scale and crop, and desaturate.
 *
 * @group Image
 * @requires extension gd

error: patch failed: core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php:9
error: core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php: patch does not apply

Thanks.

mrinalini9’s picture

Status: Needs work » Needs review
StatusFileSize
new64.62 KB

Rerolled patch #6 for 10.0.x, please review it.

quietone’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Time for a reroll

ravi.shankar’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new62.63 KB
new47.23 KB

Added reroll of patch #10 on Drupal 10.0.x. and removed needs reroll tag.

smustgrave’s picture

Status: Needs review » Needs work

Seems to be some failures in the tests.

spokje’s picture

Issue tags: +Needs reroll

Needs a reroll.

Also, when running this locally, there are quite a few new functions after the time of the last patch that have multiple-line short descriptions, so they have to be changed as well.

medha kumari’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new62.13 KB

Rerolled the patch #12 in Drupal 10.0.x.

smustgrave’s picture

Status: Needs review » Needs work

Still appear to be failures in the patch.

Also for #14 this should be checked.

This can be tested by commenting out in the phpcs file.
Applying the patch
Running the commit-code-check.sh and verifying the files being addressed here are passing.

quietone’s picture

In case anyone is wondering what commit-code-check.sh is, have a look at the instructions for running the coding standard checks locally so you can be sure the tests will run before uploading a patch. It also has the advantage of saving resources, including money, for the Drupal association. There are real costs for running the tests.

quietone’s picture

Status: Needs work » Needs review

Restore drupalci and now setting back to NR.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Tested the same way as before.

Commented out phpcs exclude line and ran the code-commit-check.sh and confirmed the files being addressed in this ticket are not throwing errors.

Change looks good to me then.

smustgrave’s picture

Went back and reread them and they look fine

Only one that stood out for maybe a second opinion is but the brief work I've done in Xss.php those sounds right.

 * @see \Drupal\Component\Utility\Xss::filter()
 * @see \Drupal\Component\Utility\UrlHelper::filterBadProtocol
 * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols
xjm’s picture

Can I ask in advance of reviewing this one that it also be converted to an MR? There will be suggestions. I can tell already by the second hunk. :)

quietone’s picture

Status: Reviewed & tested by the community » Needs work

@smustgrave, thanks for reading the changes.

@xjm, all of these siblings have been converted to MRs.

quietone’s picture

Status: Needs work » Needs review
Issue tags: +Needs followup

Setting back to Needs review.

Needs followup to look at \Drupal\KernelTests\Core\Common\XssUnitTest as mentioned in this comment

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs followup

Opened #3337286: Look into XssUnitTest Comments for the followup

That appeared to be the only open thread I could tell.

xjm’s picture

Hiding patches for clarity.

xjm’s picture

Status: Reviewed & tested by the community » Needs work

Added a couple more suggestions. "Test module" is not a helpful file docblock. One of the proposed docblocks also went against our coding standards by not having complete sentences.

Thanks!

xjm’s picture

Status: Needs work » Reviewed & tested by the community

Sorry, that comment was meant for the other issue.

xjm’s picture

Status: Reviewed & tested by the community » Needs work

I started from the end of the MR this time, because I confused this issue with another one. I guess there are at least three issues related to this rule.

xjm’s picture

Fixing attribution.

quietone’s picture

quietone’s picture

Issue tags: -Needs followup

All followups made

quietone’s picture

Status: Needs work » Needs review

This is ready for reviews.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new90 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

quietone’s picture

Status: Needs work » Needs review

Rebased and tests are running

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Took another shot at this. 95 is a lot of changes and covering a wide range of topics. But looking at what's there, they make sense and tell me what the test does.

longwave’s picture

Status: Reviewed & tested by the community » Needs work

A few nitpicks but this is looking almost ready to go.

Is it possible to enable this rule for tests only in phpcs.xml.dist to avoid future regressions?

Rishabh Vishwakarma made their first commit to this issue’s fork.

quietone’s picture

@Rishabh Vishwakarma, thanks for the interest in this work. Please make your commit message reflect the changes that you have made. The commit message at the bottom of an issue is for a maintainer to use when committing to a project. I also recommend that you use the suggestions feature in GitLab when working on coding standards issues that are using an MR.

quietone’s picture

Status: Needs work » Needs review

Time for a review again.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Don't mind marking this.

These are not my best but reading through the changes they make sense to me.

longwave’s picture

Re #39 this is not quite possible at present; Drupal.Commenting.DocComment.ShortSingleLine does not distinguish between class comments and method comments, and while this issue solves the class comments in tests, there are still about 130 method comments that are longer than one line.

  • longwave committed c03c29f5 on 10.0.x
    Issue #3268809 by quietone, Rishabh Vishwakarma, ravi.shankar, Medha...

  • longwave committed b4829d2f on 10.1.x
    Issue #3268809 by quietone, Rishabh Vishwakarma, ravi.shankar, Medha...

  • longwave committed 040893f9 on 9.5.x
    Issue #3268809 by quietone, Rishabh Vishwakarma, ravi.shankar, Medha...
longwave’s picture

Version: 10.0.x-dev » 9.5.x-dev
Status: Reviewed & tested by the community » Fixed

Re-reviewed the whole patch and I couldn't find anything else to nitpick at. We can catch any stragglers in a followup when we eventually enable the Coder rule.

Committed and pushed to 10.1.x and backported to 10.0.x and 9.5.x to make future test backports easier. Thanks everyone!

andypost’s picture

Status: Fixed » Needs work

It needs quick-fix as CI testing failed for 10.1 branch - https://www.drupal.org/pift-ci-job/2635635

moreover it broke testing patches https://www.drupal.org/pift-ci-job/2635665

  • catch committed f8869409 on 10.1.x
    Revert "Issue #3268809 by quietone, Rishabh Vishwakarma, ravi.shankar,...

  • catch committed b653e639 on 9.5.x
    Revert "Issue #3268809 by quietone, Rishabh Vishwakarma, ravi.shankar,...
catch’s picture

Reverted from all three branches - this is a conflict with the new @covers rule from phpunit-phpstan

  • catch committed c56d99c5 on 10.0.x
    Revert "Issue #3268809 by quietone, Rishabh Vishwakarma, ravi.shankar,...
spokje’s picture

Status: Needs work » Needs review
andypost’s picture

Version: 9.5.x-dev » 10.1.x-dev
Status: Needs review » Reviewed & tested by the community
Manoj Raj.R’s picture

Reviewed and looks good to me as well.

  • longwave committed 3387c4d4 on 10.0.x
    Issue #3268809 by quietone, Spokje, Rishabh Vishwakarma, ravi.shankar,...

  • longwave committed 7710bd60 on 10.1.x
    Issue #3268809 by quietone, Spokje, Rishabh Vishwakarma, ravi.shankar,...
longwave’s picture

Status: Reviewed & tested by the community » Fixed

Re-committed to 10.1.x, 10.0.x and 9.5.x. Thanks again!

  • longwave committed 4d996506 on 9.5.x
    Issue #3268809 by quietone, Spokje, Rishabh Vishwakarma, ravi.shankar,...

Status: Fixed » Closed (fixed)

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