Problem/Motivation

Some comments have two periods at the end of a sentence, e.g.

 Warn the user that a metapackage file has been updated..

Proposed resolution

Remove extra periods at end of sentences in comments.

Remaining tasks

Postponed on #3126860: Add a sniff to fix duplicate full stops in comments

  1. Find all the places with extra periods
  2. Create patch to remove the extras
  3. Review
  4. Commit

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Comments

Amsteri created an issue. See original summary.

amsteri’s picture

Status: Active » Needs review
StatusFileSize
new525 bytes
id.conky’s picture

Status: Needs review » Reviewed & tested by the community
init90’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Novice
StatusFileSize
new177.5 KB

We have more comments with such a problem(look at the screenshot). I think the optimal way is fixing them all in this issue.
Set to "Needs work" for that.

Regexp: \w\.\.$

JoceNeovia’s picture

longwave’s picture

Title: Adjustment to method annotation » Several comments end in multiple full stops
Status: Needs work » Needs review

Thanks for the patch! If you set the issue status to "needs review" then the testbot will automatically test your patch for you.

I updated the title to more accurately reflect the wider scope of this issue.

longwave’s picture

Component: user system » documentation
longwave’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Thank you for your work on cleaning up Drupal core's code style!

In order to fix core coding standards in a maintainable way, all our coding standards issues should be done on a per-rule basis across all of core, rather than fixing standards in individual modules or files. We should also separate fixes where we need to write new documentation from fixes where we need to correct existing standards. This all should be done as part of #2571965: [meta] Fix PHP coding standards in core, stage 1. A good place to start is the child issues of #2572645: [Meta] Fix 'Drupal.Commenting.FunctionComment' coding standard.

This one requires updates of the existing coder rules to detect multiple multiple fullstops. There are quite a few rules that detect fullstops on the end of comments. Once we've fixed the rules then we need to get the rules applied to core.

For background information on why we usually will not commit coding standards fixes that aren't scoped in that way, see the core issue scope guidelines, especially the note about coding standards cleanups. That document also includes numerous suggestions for scoping issues including documentation coding standards cleanups.

Contributing to the overall plan above will help ensure that your fixes for core's coding standards remain in core the long term.

mradcliffe’s picture

I performed Novice Triage on this issue. I am leaving the Novice tag on this issue and added the Needs issue summary update tag because the issue summary should provide a little bit more detail based on @alexpott's comment regarding the next steps.

I think that this may be blocked on coder updates. Adding #2571965: [meta] Fix PHP coding standards in core, stage 1 as a parent issue might help and trying to find or create an issue to fix the rule in coder would also help relate the issues together.

jungle’s picture

Version: 8.8.x-dev » 8.9.x-dev
Status: Needs work » Needs review
Related issues: +#3126860: Add a sniff to fix duplicate full stops in comments
StatusFileSize
new14.17 KB
new1.28 KB
  1. A PR requested to coder added a sniffer, see https://github.com/pfrenssen/coder/pull/101
  2. Found one more by using the sniffer
  3. --- a/core/tests/Drupal/Tests/ComposerIntegrationTest.php
    +++ b/core/tests/Drupal/Tests/ComposerIntegrationTest.php
    @@ -79,7 +79,7 @@ public function testAllModulesReplaced() {
         // Get a list of all the files in the module path.
         $folders = scandir($module_path);
     
    -    // Make sure we only deal with directories that aren't . or ..
    +    // Make sure we only deal with directories that aren't '.' or '..'.
         $module_names = [];
         $discard = ['.', '..'];
         foreach ($folders as $file_name) {
    

    Used single quotes to bypass phpcbf correcting

kristen pol’s picture

Assigned: Unassigned » kristen pol
kristen pol’s picture

Assigned: kristen pol » Unassigned
Status: Needs review » Needs work

Thanks for the updated patch.

1) The changes look good.

2) Patch applies cleanly.

[mac:kristen:drupal-8.9.x-dev]$ patch -p1 < 3117662-11.patch 
patching file composer/Generator/PackageGenerator.php
patching file core/lib/Drupal/Component/PhpStorage/FileStorage.php
patching file core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php
patching file core/lib/Drupal/Core/Field/WidgetInterface.php
patching file core/lib/Drupal/Core/Form/FormBuilder.php
patching file core/lib/Drupal/Core/Routing/AccessAwareRouterInterface.php
patching file core/lib/Drupal/Core/Routing/StackedRouteMatchInterface.php
patching file core/modules/contact/tests/src/Functional/ContactSitewideTest.php
patching file core/modules/field/src/FieldStorageConfigInterface.php
patching file core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
patching file core/modules/migrate/src/Row.php
patching file core/modules/search/search.pages.inc
patching file core/modules/system/tests/src/Functional/Form/ElementTest.php
patching file core/modules/taxonomy/src/Plugin/views/argument_validator/Term.php
patching file core/modules/user/src/UserInterface.php
patching file core/modules/views/src/Plugin/views/display/PathPluginBase.php
patching file core/modules/views/src/Plugin/views/style/StylePluginBase.php
patching file core/modules/views/tests/src/Functional/Plugin/PagerTest.php
patching file core/modules/views_ui/tests/src/Functional/GroupByTest.php
patching file core/tests/Drupal/KernelTests/Core/Database/QueryTest.php
patching file core/tests/Drupal/Tests/ComposerIntegrationTest.php
patching file core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscoveryWithObject.php

3) I found one remaining line when searching the 8.9 dev codebase after patching so moving back to "Needs work".

core/misc/tabledrag.es6.js

    // Initialize the specified columns (for example, weight or parent columns)
    // to show or hide according to user preference. This aids accessibility
    // so that, e.g., screen reader users can choose to enter weight values and
    // manipulate form elements directly, rather than using drag-and-drop..
    self.initColumns();
kristen pol’s picture

Issue summary: View changes
kristen pol’s picture

Title: Several comments end in multiple full stops » Several comments have sentences with extra periods at the end
kristen pol’s picture

Found a couple more:

  • ./core/modules/simpletest/simpletest.module: @trigger_error(__FUNCTION__ . ' is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Access the environment_cleaner service and call its cleanEnvironment() method, or use \Drupal\Core\Test\EnvironmentCleaner::cleanEnvironment() instead.. See https://www.drupal.org/node/3076634', E_USER_DEPRECATED);
  • ./core/modules/simpletest/tests/src/Kernel/DeprecatedCleanupTest.php: * @expectedDeprecation simpletest_clean_environment is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Access the environment_cleaner service and call its cleanEnvironment() method, or use \Drupal\Core\Test\EnvironmentCleaner::cleanEnvironment() instead.. See https://www.drupal.org/node/3076634
iyyappan.govind’s picture

StatusFileSize
new16.04 KB
new1.58 KB

Hi Folks,

I have updated the patch to fix this coding in couple of the files below

Searching 15986 files for "\w\.\.$" (regex)

/var/www/html/drupalcorecopy/core/misc/tabledrag.es6.js:
  244      // to show or hide according to user preference. This aids accessibility
  245      // so that, e.g., screen reader users can choose to enter weight values and
  246:     // manipulate form elements directly, rather than using drag-and-drop..
  247      self.initColumns();
  248  

/var/www/html/drupalcorecopy/core/profiles/demo_umami/modules/demo_umami_content/default_content/images/home-grown-herbs.jpg:
    <binary>

/var/www/html/drupalcorecopy/core/tests/Drupal/Tests/Core/Asset/library_test_files/licenses.libraries.yml:
    1: # No license information: should default to GPL 2.0 or later..
    2  no-license-info:
    3    version: 1.0

/var/www/html/drupalcorecopy/core/themes/claro/js/tabledrag.es6.js:
  281      // to show or hide according to user preference. This aids accessibility
  282      // so that, e.g., screen reader users can choose to enter weight values and
  283:     // manipulate form elements directly, rather than using drag-and-drop..
  284      self.initColumns();
  285  

4 matches across 4 files
jungle’s picture

Thanks to @Kristen Pol for reviewing and thanks to @iyyappan.govind for submitting a new patch.

Todo: needs to address #16.

jungle’s picture

Status: Needs work » Postponed

Based on @alexpott's comment in #9, let's postpone this waiting for #3126860: Add a sniff to fix duplicate full stops in comments landing first

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

jungle’s picture

Closed #3154903: Fix double periods at the end of sentences as a duplicate. Please credit @ju.vanderw here who filed it and submitted patch, and others if applicable. Thanks!

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Component: documentation » other
Category: Bug report » Task
Issue tags: -Novice +Coding standards, +Bug Smash Initiative

Removing Novice tag because this is postponed. Adding coding standards tag and changing to a task.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

quietone’s picture

Status: Postponed » Closed (duplicate)

Closing as a duplicate of a later issue with an MR and moving credit