Problem/Motivation

There's a typo in a WidgetInterface.php comment.

Steps to reproduce

Proposed resolution

Use SlevomatCodingStandard.Commenting.ForbiddenComments as suggested by longwave in #3126860-7: Add a sniff to fix duplicate full stops in comments

Remaining tasks

Review
Commit

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3486996

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

kgaut created an issue. See original summary.

kgaut’s picture

Status: Active » Needs review
kgaut’s picture

Version: 11.1.x-dev » 11.0.x-dev
smustgrave’s picture

Title: Typo in WidgetInterface.php » Extra period in WidgetInterface.php
Version: 11.0.x-dev » 11.x-dev
Status: Needs review » Reviewed & tested by the community
longwave’s picture

Title: Extra period in WidgetInterface.php » Extra periods at the end of comment lines
Component: field system » documentation
Status: Reviewed & tested by the community » Needs work

Usually we try to fix all instances of the same issue in one go, with a regular expression search [^\.]\.\.$ we can find all instances of two periods at the end of a line so let's try to address all these at once:

core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscoveryWithObject.php
10: * Defines test derivative discovery using an object..

core/tests/Drupal/Tests/Core/Asset/library_test_files/licenses.libraries.yml
1:# No license information: should default to GPL 2.0 or later..

core/lib/Drupal/Component/PhpStorage/FileStorage.php
26:   *     the same configuration, but for different bins..

core/lib/Drupal/Core/Cache/CacheTagsChecksumTrait.php
135:    // so return early..

core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php
162:   *   A representative subset of the given set of cache context tokens..

core/lib/Drupal/Core/Routing/AccessAwareRouterInterface.php
15:   * Attribute name of the access result for the request..

core/lib/Drupal/Core/Routing/StackedRouteMatchInterface.php
22:   * Gets the master route match..

core/lib/Drupal/Core/Form/FormBuilder.php
850:    // when the request uri starts with multiple slashes..

core/lib/Drupal/Core/Field/WidgetInterface.php
14: * Drupal\Core\Field\WidgetBase..

core/misc/tabledrag.js
261:    // manipulate form elements directly, rather than using drag-and-drop..

core/modules/search/search.pages.inc
53:  // Provide separated and grouped meta information..

core/modules/pgsql/src/Driver/Database/pgsql/Schema.php
1098:   * Retrieves a sequence name that is owned by the table and column..

core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
122:    // Check empty files import with a user that cannot access site reports..

core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php
307:    // Enable translation for pages and menu link content..

core/modules/ckeditor5/tests/src/Unit/HTMLRestrictionsTest.php
955:    // Basic cases: attributes..

core/modules/user/src/UserInterface.php
137:   * Sets the UNIX timestamp when the user last accessed the site..

core/modules/views_ui/tests/src/Functional/GroupByTest.php
8: * Tests UI of aggregate functionality..

core/modules/options/tests/src/Functional/OptionsWidgetsTest.php
619:    // Verify that a test radio button has a "N/A" choice..

core/modules/field/src/FieldStorageConfigInterface.php
136:   * Sets the custom storage indexes for the field data storage..

core/modules/views/src/Plugin/views/style/StylePluginBase.php
482:   *   - rows: The result rows to be rendered in this group..

core/modules/views/src/Plugin/views/field/FieldHandlerInterface.php
62:   * Returns a wrapper HTML element for the field..

core/modules/views/src/Plugin/views/display/PathPluginBase.php
267:    // Find all paths which match the path of the current display..

core/modules/views/tests/src/Functional/Plugin/PagerTest.php
535:    // Translation mapping..

core/modules/contact/tests/src/Functional/ContactSitewideTest.php
559:   *   The path where user will be redirect after this form has been submitted..

core/modules/system/tests/src/Functional/Form/ElementTest.php
182:   * Tests a form with an autocomplete setting..

core/modules/migrate/src/Row.php
416:   * Returns the hash for the source values..
smustgrave’s picture

Issue tags: +Novice

Good point @longwave

kgaut’s picture

Version: 11.x-dev » 11.0.x-dev
Component: documentation » field system
Status: Needs work » Needs review

Done @longwave :)

ram4nd’s picture

Status: Needs review » Reviewed & tested by the community

Looks good

quietone credited alexpott.

quietone credited Amsteri.

quietone credited init90.

quietone credited jungle.

quietone’s picture

Version: 11.0.x-dev » 11.1.x-dev
Component: field system » other
Assigned: kgaut » Unassigned
Category: Bug report » Task
Issue summary: View changes
Status: Reviewed & tested by the community » Postponed
Issue tags: -Novice +Coding standards
Parent issue: » #2571965: [meta] Fix PHP coding standards in core, stage 1
Related issues: +#3117662: Several comments have sentences with extra periods at the end, +#3126860: Add a sniff to fix duplicate full stops in comments

Thanks for working to improve the readability of our comments.

This is actually a Coding standard fix and should be done by a sniff, so that we can be sure no such errors are introduced in the future. Unfortunately, this is a duplicate of an existing core issue which already has a patch, so this is duplicating existing editing and review work. Since we are already waiting on the sniff, I am closing the other issue as a duplicate because this has an MR, which is preferred and postponing on the sniff. I am also moving credit from that issue.

And updating the issue meta data to use the 'main' branch which is 11.x, and set to a 'Task' in the 'other' component which is where coding standards issues normally go and adding as a child of the Meta for PHP coding standards.

Cheers

quietone’s picture

Version: 11.1.x-dev » 11.x-dev
quietone’s picture

Issue summary: View changes
Status: Postponed » Needs review

Linting passed, time for review.

dcam’s picture

Status: Needs review » Needs work

As noted in #6 there's a double stop on line 261 of tabledrag.js. But that isn't fixed in the MR. The linting that was added was a PHPCS rule, so it makes sense that this was missed. I don't suppose we have access to a JS equivalent, do we? Either way, tabledrag.js needs to be edited.

quietone’s picture

Status: Needs work » Needs review

Updated for the js file and no more instances were found with the following.

$ git grep  "[^\.]\.\.$"
$
needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

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

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

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

quietone’s picture

Status: Needs work » Needs review

Another rebase, and no conflicts.

dcam’s picture

Status: Needs review » Reviewed & tested by the community

Feedback was addressed. This is RTBC.

quietone’s picture

Status: Reviewed & tested by the community » Needs review

Changed to use the regex used by Coder in #3126860: Add a sniff to fix duplicate full stops in comments

dcam’s picture

Status: Needs review » Reviewed & tested by the community

I verified that the new regex is the same that went into Coder. Then I tested PHPCS on one of the double-stops that's being patched here. Here are the results:

~/drupal_core$ phpcs core/tests/Drupal/Tests/Core/Htmx/

FILE: /var/www/html/core/tests/Drupal/Tests/Core/Htmx/HtmxUtilitiesTest.php
-----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
 113 | ERROR | [x] Documentation comment contains forbidden comment "Test ::applyTo with attribute key..".
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------

This looks good to me.

xjm’s picture

Title: Extra periods at the end of comment lines » Fix extra periods at the end of comment lines

  • xjm committed b20673e1 on 11.x
    Issue #3486996 by kgaut, longwave, alexpott, amsteri, init90, jungle,...
xjm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 11.x. I considered backporting it to 11.2.x without the rule with some fancy git tap-dancing, but there are also at least two merge conflicts with the fixed comments, so since this is just basically silly typos I think it's safe to leave this one as 11.x only.

Thanks everyone!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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