Problem/Motivation
Fix duplicated words in core, i.e. 'settings settings'. Keep in mind that in English there are situations where a duplicate word is correct. Here are examples from https://www.grammarphobia.com/blog/2013/08/this-and-that.html
- “I can see that that is going to be a problem.”
- “I received this this morning.”
Original report
Repeated 'settings' word in multiple files
Steps to reproduce
Proposed resolution
Grep for all potential instances of incorrectly duplicated words and remove the instances that are clearly wrong:
This should find any duplicated words in docblocks:
egrep -r '\<([a-zA-Z]+)\> \<\1\>' ./ | grep -v 'node_modules' | grep -v 'vendor' | grep '* '
This should find any duplicated words in inline comments:
egrep -r '\<([a-zA-Z]+)\> \<\1\>' ./ | grep -v 'node_modules' | grep -v 'vendor' | grep '// '
Occasionally, a duplicated word is actually correct. (E.g. "that that" is grammatically correct in some cases in English, and there are also other instances like annotation/parameter declarations where it might be correct.) So don't just blindly remove the duplicated word -- check each one.
Remaining tasks
Patch
Review
User interface changes
API changes
Data model changes
Release notes snippet
Problem/Motivation
| Comment | File | Size | Author |
|---|---|---|---|
| #29 | interdiff_26-29.txt | 931 bytes | murilohp |
| #29 | 3175287-29.patch | 35.3 KB | murilohp |
| #26 | interdiff_3175287_24-26.txt | 1.74 KB | ankithashetty |
| #26 | 3175287-26.patch | 35.08 KB | ankithashetty |
| #24 | reroll_diff_17-24.txt | 28.09 KB | murilohp |
Comments
Comment #2
abhijith s commentedComment #3
abhijith s commentedApplied patch .It works fine .Those additional words are removed
Comment #4
abhijith s commentedComment #5
abhijith s commentedComment #6
xjmInstead of fixing these one word at a time, we should grep for all potential instances of incorrectly duplicated words and remove the instances that are clearly wrong:
This should find any duplicated words in docblocks:
This should find any duplicated words in inline comments:
Occasionally, a duplicated word is actually correct. (E.g. "that that" is grammatically correct in some cases in English, and there are also other instances like annotation/parameter declarations where it might be correct.) So don't just blindly remove the duplicated word -- check each one.
Thanks!
Comment #7
xjmComment #8
quietone commented@xjm, That make much more sense.
Updated the IS to include #6.
I ran the grep commands on core to see how many instances need to be examined.
Comment #10
alvar0hurtad0Still working on this @Abhijith S?
Comment #11
sarvjeetsingh commentedComment #12
sarvjeetsingh commentedUsed grep commands to find out instances that had repetitive words. Please review.
Comment #13
pranali.lanjewar commentedComment #14
pranali.lanjewar commentedComment #15
quietone commentedCame to do a review but the patch did not apply so I rerolled it. Then ran the grep commands and looks like there is more work to do.
Not running the tests because this is changes to comments and there is work to do.
Comment #16
sivaprasadc commentedComment #17
sivaprasadc commented@quietone Thanks for the patch. It is applied cleanly.
I have created the patch file to fix the duplicate words. Please find the attached.
After applying the patch, Still, we can see the duplicated words in docblocks:
egrep -r '\<([a-zA-Z]+)\> \<\1\>' ./ | grep -v 'node_modules' | grep -v 'vendor' | grep '* 'we can see the duplicated words in inline comments:
These seem to be valid to me. Kindly review and share the feedback.
Comment #18
volkswagenchickThis is already tagged novice, I am adding the
Europe2020tag. Thanks.Comment #19
michaellenahan commentedComment #22
vikashsoni commentedPatch not applying in drupal-9.3.x-dev
Needs to reoll
Comment #23
volkswagenchickMarking this Needs Work, thanks.
Comment #24
murilohp commentedHey I made the reroll of patch #17 to branch 9.4.x.
Thanks!
Comment #25
murilohp commentedMoving to needs review again!
Comment #26
ankithashettyUpdated the patch in #24 to remove the changes made to
core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.phpfile, as it's already been merged here #3255836: Test fails due to Composer 2.2.Thanks!
Comment #27
avpadernoAll the changes done by last patch are correct.
Comment #28
longwaveThis can now be rewrapped at 80 characters.
Once this is done this looks ready to go.
Comment #29
murilohp commentedHey @ankithashetty thanks for your help! @longwave I rewrapped, on this new patch, thanks for bringing this up!
Thanks!
Comment #30
longwaveThanks - this all looks good to me.
Comment #31
alexpottCommitted and pushed adff905c9ef to 10.0.x and 9caf7d9aaf4 to 9.4.x and 923ad8611fa to 9.3.x. Thanks!
Backported to 9.3.x to keep code aligned and since this only changed comments.
Re-flowed the above comments now that we can fit more on a line.