Problem/Motivation
Discovered at #2972224: Add .cspell.json to automate spellchecking in Drupal core, and pointed by @xjm in https://www.drupal.org/project/drupal/issues/3122088#comment-13628724
+++ b/core/.cspell.json
@@ -0,0 +1,1288 @@
+ "Deduplicates",
...
+ "Reimplement",
...
+ "Reparenting",
...
+ "Rerender",
+ "Resaving",
+ "Rethrown",
+ "Reuploading",
...
+ "Unassigns",
...
+ "Unclickable",
+ "Ungroupable",
+ "Ungrouped",
+ "Unhide",
...
+ "Unknow",
...
+ "Unpad",
...
+ "Unprefix",
...
+ "Unrouted",
...
+ "deprioritize",
...
+ "reimplementing",
+ "reindex",
+ "reindexing",
+ "reinitializes",
+ "reinject",
...
+ "renormalize",
+ "reparenting",
...
+ "rerender",
+ "rerendered",
+ "rerendering",
+ "resaved",
+ "resaving",
...
+ "rethrown",
...
+ "undecorate",
...
+ "ungroup",
+ "ungroupable",
+ "ungrouped",
+ "unhashed",
+ "unhide",
+ "unindented",
+ "unindexed",
...
+ "unitalicize",
+ "unkeyed",
...
+ "unpermissioned",
...
+ "unrendered",
...
+ "unshortened",
+ "unsanitized"
+
@xjm:Should be hyphenated (un-assign, de-prioritize, re-render, etc.)
There's an interesting question of where to draw the line for these. Generally in English these prefixes are morphologically productive with a hyphen, and get de-hyphenated when the word is adopted into common usage. "Denormalize", "Unsanitized", "Uninstantiated" etc. are all obviously in common usage in programming. "Unsticky", "Unrevisionable", and the like are Drupal terminology, and I'm surprised that "unpublish" and friends aren't already in the main dictionary.
Proposed resolution
As title and see the change record https://www.drupal.org/node/3122084 for how to work with cspell.
Remaining tasks
Pick out all applicable words from #2972224: Add .cspell.json to automate spellchecking in Drupal core and fix them.
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #34 | interdiff_30-34.txt | 10.22 KB | deepak goyal |
| #34 | 3138768-34.patch | 107.24 KB | deepak goyal |
| #30 | interdiff_19-30.txt | 16.28 KB | deepak goyal |
| #30 | 3138768-30.patch | 108.76 KB | deepak goyal |
| #21 | test_screenshot_2.png | 16.42 KB | adityasingh |
Comments
Comment #2
jungleComment #3
mohrerao commentedComment #4
mohrerao commentedAdding a patch.
Comment #5
ramya balasubramanian commentedI will review this patch.
Comment #6
ramya balasubramanian commentedComment #7
ramya balasubramanian commentedHi @moheraro,
I have tested this patch. This was applied successfully but I have seen 4 warnings regarding the whitespaces. Kindly have a look. I have attached the screenshot also.
Comment #8
mohrerao commentedThanks for that Ramya! Fixing it
Comment #9
mohrerao commentedFixed issues highlighted by @ramya.
Comment #10
shobhit_juyal commentedPatch #9 applied successfully.
Comment #11
maithri shetty commentedComment #12
shobhit_juyal commentedSome words can still found in the core like "Rerender" using command "grep -ri".
Comment #13
mohrerao commentedUpdated issue description. Added unsanitized to the list
Comment #14
longwaveI don't think this is right, "unknown" is a valid word.
Comment #15
mohrerao commentedUpdated 3138768-9.patch
Changed it back to unknown
--- b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php+++ b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
@@ -83,7 +83,7 @@
// Flat list of textual values.
$string = "Zero\nOne";
$array = ['0' => 'Zero', '1' => 'One'];
- $this->assertAllowedValuesInput($string, $array, 'Unkeyed lists are accepted.');
+ $this->assertAllowedValuesInput($string, $array, 'Non-keyed lists are accepted.');
Comment #16
shobhit_juyal commentedThanks @mohrerao, for the updation, but I got one more to fix.
Comment #17
mohrerao commentedFix for #16
Comment #18
shobhit_juyal commentedIt looks like "unrouted" is still there.
Comment #19
mrinalini9 commentedUpdated patch and fixed "unrouted" as mentioned in #18, please review.
Comment #20
adityasingh commentedI'm reviewing this
Comment #21
adityasingh commentedI have used command "grep -ri" and found no more issues related with spellings, ready for RTBC.
Comment #22
adityasingh commentedComment #23
adityasingh commentedI have used command "grep -ri" and found no more issues related with spellings, ready for RTBC. Also attached the screenshots.
Comment #24
xjmThanks everyone for your interest in working on this issue.
The patch for this issue should not change any files in
core/assets/vendor, as those are non-Drupal libraries within the codebase.Now that #2972224: Add .cspell.json to automate spellchecking in Drupal core is in, we can make sure this spelling error never happens again by removing the entry from Drupal's dictionrary, so let's update the patch to remove the words that are being fixed here. Thanks!
Comment #25
xjmComment #26
xjmMake note of situations like this where the hyphen makes the line longer than 80 characters. In those cases, the comments will need to be re-wrapped.
I'm also not sure this change is correct for Drupal; for example, we have
hook_entity_presave()(nothook_entity_pre_save(). I'd omit this from the patch for now.I'd also suggest a more structured way of looking at this issue: Take all the words in the core dictionary that start with common prefixes (e.g. "un-", "de-", "re-" etc.), put them in the summary, and then as a group, with first-language speakers contributing, decide which are words in Drupal and which should be hyphenated.
Comment #27
xjmComment #28
jungleIn addition to #26
Unexpected changes to indentation
Over 80 chars, or see #26.1
Comment #29
deepak goyal commentedComment #30
deepak goyal commentedHi @jungle
Made changes as you suggested please review.
Comment #31
longwaveI'd agree with this. This is getting tricky to review with the number of changes, it might be better to break this up into groups of words and do them separately. In the meantime:
These reformatting changes are out of scope.
Deduplicates and duplicates are not the same.
This doesn't make sense any more. How about "Tests an anonymous user without permission..."
This seems to be reformatting only, this is out of scope.
Some words are missing here, this no longer makes sense.
If we are changing reindexing to re-indexing, does the method need to be renamed markForReIndex()?
This needs rewrapping.
Comment #32
jungleHow about rescoping this one to one of "un-", "de-", "re-" etc.? Encourage filing new issues for the rest as child issues of #3122088: [Meta] Remove spelling errors from dictionary.txt and fix them
Comment #33
deepak goyal commentedComment #34
deepak goyal commentedHi @longwave
Made changes please review.
Comment #35
jungleAs we already made great progress here, and splitting this into child issues will lose all works almost -- it's hard to reuse works here in child issues. I found it's easy to have an extra review with
git diff --color-words, so let's continue here.Wrapped too early
cd core && yarn && yarn build:js && yarn build:csscore/misc/cspell/dictionary.txt. or re-generate the dictionarycd core && yarn && yarn spellcheck:make-drupal-dictComment #36
davidhernandezIt feels like each of these should be evaluated individually?
Unrouted is a valid word without hyphen.
Unsanitized also appears in the dictionary without hyphen.
Reinject also appears in Merriam-Webster without hyphen.
Anyone know what the authoritative source is the spellchecked uses or are we proposing to just go with whatever the spell checker says for simplicity?
Comment #38
quietone commentedI don't follow why work would be lost.
I agree with longwave that reviewing this is tricky and thus I think effort should be made to make it simpler for the reviewer. Things like
adding a section to the IS explaining unique situations, like Presave in #26.2 and if un-route or unroute is to be used. And right now I favor separate issues, one each for 're', 'de' and 'un'.
Comment #41
andregp commentedI created three child issues, as suggested, and tried my best to document there the most relevant points from this issue's discussion.
#3265329: Fix missing hyphens for prefixes - Words starting with "de"
#3265330: Fix missing hyphens for prefixes - Words starting with "re"
#3265331: [meta] Fix missing hyphens for prefixes - Words starting with "un"
Comment #44
quietone commentedAdding tag for the cspell spelling error issues.
Comment #46
quietone commentedSince #41 when the child issues were made, this became a meta.