Problem/Motivation

In issue #950534 Consistently use "email" instead of "e-mail" in Drupal participants arrived at a common agreement to follow global grammatical standards of English language and accept the "email" as the only valid form of this term. That happened 5 years ago in 2014.

However, today grepping for the /\se-mail/ regex pattern in the 8.8.x-dev core/ directory results 50+ occurrences again. (Results on Gitlab)

As suggested there, I open this new issue thread to post my patch against version 8.8.x-dev fixing these strings in a one-run batch.

The policy is at Industry-related words section of the Content Style guide

Steps to reproduce

Proposed resolution

Change e-mail to email.

Remaining tasks

Add "e-mail" to flagWords in cspell.json
Run spell check on core to find the remaining instances
Patch
Review
Commit

User interface changes

Possibly?

API changes

Data model changes

Release notes snippet

Comments

Balu Ertl created an issue. See original summary.

baluertl’s picture

Status: Active » Needs review
StatusFileSize
new29.83 KB

First run, let's see what tests say...

Status: Needs review » Needs work

The last submitted patch, 2: 950534-using-email-instead-e-mail-2.patch, failed testing. View results

pandaski’s picture

length of the string is 100 after the change

-  'options' => 'a:1:{s:10:"attributes";a:1:{s:5:"title";s:101:"Configure default behavior of users, including registration requirements, e-mails, and user pictures.";}}',
+  'options' => 'a:1:{s:10:"attributes";a:1:{s:5:"title";s:101:"Configure default behavior of users, including registration requirements, emails, and user pictures.";}}',
baluertl’s picture

Status: Needs work » Needs review
StatusFileSize
new29.83 KB

@Joseph Zhao good catch, thanks! I decreased string length number of every affected lines in both test fixture files.

baluertl’s picture

Assigned: baluertl » Unassigned

Tests passed, so waiting for RTBC...

pandaski’s picture

Status: Needs review » Reviewed & tested by the community

Verified no more 'e-mail' exists in Core.

This looks RTBC to me,

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.

What we need here is a new rule added to the coder project to check our code for adding e-mail as we're obviously not going to remember this decision in the future.

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.

+++ b/core/modules/migrate_drupal/tests/fixtures/drupal6.php
@@ -191,7 +191,7 @@
-  'description' => 'Send e-mail',
+  'description' => 'Send email',

@@ -15324,14 +15324,14 @@
-  'source' => "The <em>From</em> address in automated e-mails sent during registration and new password requests, and other notifications. (Use an address ending in your site's domain to help prevent this e-mail being flagged as spam.)",
+  'source' => "The <em>From</em> address in automated emails sent during registration and new password requests, and other notifications. (Use an address ending in your site's domain to help prevent this email being flagged as spam.)",

This is life as it was in Drupal 6 and we should not be changing it here - or anywhere else in this file. Or in the Drupal 7 file.

baluertl’s picture

@alexpott thanks for taking time to write down these instructions, then I'll move towards the pointed direction.

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

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

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.

Rkumar’s picture

Status: Needs work » Needs review
StatusFileSize
new31.78 KB

Adding a patch as it was failing for 9.1 and one more file included.

Status: Needs review » Needs work

The last submitted patch, 12: 3051548-using-email-instead-e-mail-12.patch, failed testing. View results

Rkumar’s picture

Status: Needs work » Needs review
StatusFileSize
new31.78 KB
tr’s picture

Status: Needs review » Needs work

Still needs a coding standards rule, as pointed out in #8, so that we don't have to keep fixing this time and time again.

baluertl’s picture

longwave’s picture

I was hoping this could be fixed in #2972224: Add .cspell.json to automate spellchecking in Drupal core but it seems hyphenated words are not recognised by cspell. I tried adding "e-mail" to the flagWords section of the config file but it didn't spot any of the uses in core.

Therefore I think the way to fix this forever is get a rule added to Coder that can check for this, if possible.

Rkumar’s picture

StatusFileSize
new13.87 KB

Updating a patch for #8
@longwave Let me see how a rule can be added in the coder.

nitesh624’s picture

Assigned: Unassigned » nitesh624
nitesh624’s picture

StatusFileSize
new31.99 KB
new17.87 KB
nitesh624’s picture

Assigned: nitesh624 » Unassigned
Status: Needs work » Needs review
priyanka.sahni’s picture

Assigned: Unassigned » priyanka.sahni
priyanka.sahni’s picture

StatusFileSize
new134.95 KB
new101.32 KB
new451.31 KB

Verified and tested by applying the patch #20.It was applied successfully and looks good to me.Can be moved to RTBC.

Steps to test-
1. Go to the a/core/ etc.
2. Search for the email.

BeforePatch -
BeforePatch

After Patch -
After Patch

After Patch all files -
After Patch

priyanka.sahni’s picture

Assigned: priyanka.sahni » Unassigned

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.

quietone’s picture

Issue tags: -coding standard +Coding standards

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.

vikashsoni’s picture

StatusFileSize
new4.65 KB

Patch #20 applied successfully after patch all the e-mail changed to email and working fine Thanks for the patch

tr’s picture

Status: Needs review » Needs work

What we need here is a new rule added to the coder project to check our code for adding e-mail as we're obviously not going to remember this decision in the future.

This was pointed out in #8, #15, and #17. See #8 for more details.

Also, please don't post screen shots just to show the patch applies. That is what DrupalCI is for, you don't need to confirm that. If the patch hasn't been tested in a while you can trigger a retest to confirm that it applies and that the tests pass.

quietone’s picture

Issue summary: View changes
Status: Needs work » Postponed
Related issues: +#2278995: Add check for e-mail vs email to codesniffer

Everyone, remember to read the issue before working on patches. It was pointed out way back on #8 that a patch here was not the next step. The contributor guide on Drupal.org has information about how to contribute. There are also clear guidelines for How is credit granted for Drupal core issues.. Adjusting credit accordingly.

As pointed in #8 a sniff needs to be added in the Coder project. The issue there is #2278995: Add check for e-mail vs email to codesniffer. Until that is complete, this is postponed.

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.

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.

quietone’s picture

Issue summary: View changes
Status: Postponed » Needs work

I tried again today to use cspell for this. I added "e-mail" to the flagWords and ran spellcheck on core and the instances were found. So, something has changed since longwave tried this in #17.

A core committer explained in #8 that work was not needed until a sniff was made in Coder. And that was repeated in #15 and #17. Patches and screenshots continued to be posted. That is not helping to resolve this and make noises in the issue. I am removing credit per How is credit granted for Drupal core issues.

nikhil_110’s picture

StatusFileSize
new42.28 KB

Attached patch against Drupal 10.1.x

quietone’s picture

Title: Maintain policy of using "email" instead of "e-mail" in Drupal » Fix spelling of "email"
Component: documentation » other

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

Status: Needs work » Needs review
StatusFileSize
new13.79 KB

Let's get this back on track.

I have made a new patch, from scratch. I added 'e-mail' as a flag word and the spell checked all of core to find the instances. I fixed those and spell checked again. The dictionary does not need to be changed. I haven't included an interdiff because the previous patches include changes to migrate related files and that will just add noise to the interdiff.

The reroll in #36 does not have a diff and it didn't take into account the previous comments about the change of approach nor that the changes to migrate files (#8) should be removed. Therefor, I am removing credit.

lauriii’s picture

Status: Needs review » Reviewed & tested by the community

Ran yarn spellcheck:core locally and it didn't return any errors:

CSpell: Files checked: 14818, Issues found: 0 in 0 files

Reviewed the patch manually to confirm all of the changes there look good 👍

longwave’s picture

+++ b/core/.cspell.json
@@ -49,7 +49,8 @@
     "flagWords": [
       "grey",
       "hte",
-      "please"
+      "please",
+      "e-mail"
     ],

Nitpick: should we keep this list in alphabetical order?

quietone’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new343 bytes
new13.81 KB

Yes, they should

lauriii’s picture

Status: Needs review » Reviewed & tested by the community

Interdiff looks good 👍

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 42: 3051548-42.patch, failed testing. View results

lauriii’s picture

Status: Needs work » Reviewed & tested by the community
longwave’s picture

Status: Reviewed & tested by the community » Fixed

Committed 758cc0e and pushed to 11.x. Thanks!

  • longwave committed 758cc0ec on 11.x
    Issue #3051548 by Rkumar, quietone, Balu Ertl, nitesh624, lauriii,...
longwave’s picture

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

Credit on this seems to have been lost, re-adding.

Status: Fixed » Closed (fixed)

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

jonathan1055’s picture

Issue summary: View changes

As this has been fixed without the use of a new sniff in Coder, it is confusing to have #2278995: Add check for e-mail vs email to codesniffer linked in the IS, therefore I have removed it. It is still in the related issues, which is OK.