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
| Comment | File | Size | Author |
|---|---|---|---|
| #42 | 3051548-42.patch | 13.81 KB | quietone |
Comments
Comment #2
baluertlFirst run, let's see what tests say...
Comment #4
pandaski commentedlength of the string is 100 after the change
Comment #5
baluertl@Joseph Zhao good catch, thanks! I decreased string length number of every affected lines in both test fixture files.
Comment #6
baluertlTests passed, so waiting for RTBC...
Comment #7
pandaski commentedVerified no more 'e-mail' exists in Core.
This looks RTBC to me,
Comment #8
alexpottThank 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.
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.
Comment #9
baluertl@alexpott thanks for taking time to write down these instructions, then I'll move towards the pointed direction.
Comment #12
Rkumar commentedAdding a patch as it was failing for 9.1 and one more file included.
Comment #14
Rkumar commentedComment #15
tr commentedStill needs a coding standards rule, as pointed out in #8, so that we don't have to keep fixing this time and time again.
Comment #16
baluertlComment #17
longwaveI 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.
Comment #18
Rkumar commentedUpdating a patch for #8
@longwave Let me see how a rule can be added in the coder.
Comment #19
nitesh624Comment #20
nitesh624Comment #21
nitesh624Comment #22
priyanka.sahni commentedComment #23
priyanka.sahni commentedVerified 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 -

After Patch -

After Patch all files -

Comment #24
priyanka.sahni commentedComment #26
quietone commentedComment #28
vikashsoni commentedPatch #20 applied successfully after patch all the e-mail changed to email and working fine Thanks for the patch
Comment #29
tr commentedThis 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.
Comment #30
quietone commentedEveryone, 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.
Comment #34
quietone commentedI 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.
Comment #35
quietone commentedComment #36
nikhil_110 commentedAttached patch against Drupal 10.1.x
Comment #37
quietone commentedComment #39
quietone commentedLet'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.
Comment #40
lauriiiRan
yarn spellcheck:corelocally and it didn't return any errors:Reviewed the patch manually to confirm all of the changes there look good 👍
Comment #41
longwaveNitpick: should we keep this list in alphabetical order?
Comment #42
quietone commentedYes, they should
Comment #43
lauriiiInterdiff looks good 👍
Comment #45
lauriiiRandom fail: #3376563: Random test fail in Drupal\Tests\Component\Utility\RandomTest::testRandomMachineNamesUniqueness.
Comment #46
longwaveCommitted 758cc0e and pushed to 11.x. Thanks!
Comment #48
longwaveComment #49
quietone commentedCredit on this seems to have been lost, re-adding.
Comment #51
jonathan1055 commentedAs 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.