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

Comments

jungle created an issue. See original summary.

jungle’s picture

mohrerao’s picture

Assigned: Unassigned » mohrerao
mohrerao’s picture

Assigned: mohrerao » Unassigned
Status: Active » Needs review
StatusFileSize
new97.85 KB

Adding a patch.

ramya balasubramanian’s picture

Assigned: Unassigned » ramya balasubramanian
Issue tags: +DIACWMay2020, +Drupal 9 porting weekend

I will review this patch.

ramya balasubramanian’s picture

Assigned: ramya balasubramanian » Unassigned
ramya balasubramanian’s picture

Hi @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.

mohrerao’s picture

Assigned: Unassigned » mohrerao

Thanks for that Ramya! Fixing it

mohrerao’s picture

StatusFileSize
new98.18 KB

Fixed issues highlighted by @ramya.

shobhit_juyal’s picture

Patch #9 applied successfully.

maithri shetty’s picture

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

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new123.29 KB

Some words can still found in the core like "Rerender" using command "grep -ri".

mohrerao’s picture

Issue summary: View changes

Updated issue description. Added unsanitized to the list

longwave’s picture

+++ b/core/assets/vendor/jquery/jquery.js
@@ -1331,7 +1331,7 @@ setDocument = Sizzle.setDocument = function( node ) {
-			// The test attribute must be unknown in Opera but "safe" for WinRT
+      // The test attribute must be un-known in Opera but "safe" for WinRT

@@ -6759,7 +6759,7 @@ function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computed
-		// If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
+    // If offsetWidth/offsetHeight is un-known, then we can't determine content-box scroll gutter

I don't think this is right, "unknown" is a valid word.

mohrerao’s picture

Assigned: mohrerao » Unassigned
Status: Needs work » Needs review
StatusFileSize
new105.34 KB
new42.48 KB

Updated 3138768-9.patch

  1. I don't think this is right, "unknown" is a valid word.

    Changed it back to unknown

  2. Have taken liberty in changing from unindexed to non-indexed as that seemed more appropriate.
  3. Changed wording in
    --- b/core/modules/node/tests/src/Functional/PageViewTest.php
    +++ b/core/modules/node/tests/src/Functional/PageViewTest.php
    @@ -17,7 +17,7 @@
       protected $defaultTheme = 'stark';
    
       /**
    -   * Tests an anonymous and un-permissioned user attempting to edit the node.
    +   * Tests an anonymous and user without permission attempting to edit the node.
        */
  4. Changed from unkeyed to non-keyed
    --- 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.');
  5. fixed missed words like reindexing, unsanitized, unrouted, unprefixed, rerender
shobhit_juyal’s picture

Status: Needs review » Needs work
StatusFileSize
new60.28 KB

Thanks @mohrerao, for the updation, but I got one more to fix.

mohrerao’s picture

Status: Needs work » Needs review
StatusFileSize
new105.34 KB
new5.16 KB

Fix for #16

shobhit_juyal’s picture

Status: Needs review » Needs work
StatusFileSize
new28.65 KB

It looks like "unrouted" is still there.

mrinalini9’s picture

Status: Needs work » Needs review
StatusFileSize
new106.13 KB
new832 bytes

Updated patch and fixed "unrouted" as mentioned in #18, please review.

adityasingh’s picture

Assigned: Unassigned » adityasingh

I'm reviewing this

adityasingh’s picture

Assigned: adityasingh » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new10.52 KB
new66.39 KB
new16.42 KB

I have used command "grep -ri" and found no more issues related with spellings, ready for RTBC.

adityasingh’s picture

adityasingh’s picture

I have used command "grep -ri" and found no more issues related with spellings, ready for RTBC. Also attached the screenshots.

xjm’s picture

Thanks 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!

xjm’s picture

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

  1. +++ b/core/lib/Drupal/Core/Render/Renderer.php
    @@ -259,7 +259,7 @@ protected function doRender(&$elements, $is_root_call = FALSE) {
    -    // Try to fetch the prerendered element from cache, replace any placeholders
    +    // Try to fetch the pre-rendered element from cache, replace any placeholders
    

    Make 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.

  2. +++ b/core/modules/content_moderation/tests/src/Kernel/InitialStateTest.php
    @@ -82,7 +82,7 @@ public function testInitialState() {
    -      'title' => 'Presave node',
    +      'title' => 'Pre-save node',
    

    I'm also not sure this change is correct for Drupal; for example, we have hook_entity_presave() (not hook_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.

xjm’s picture

Title: Fix "ShouldBeHyphenated" relevant typos in core » Fix flagged spelling errors due to missing hyphens for prefixes
jungle’s picture

In addition to #26

  1. +++ b/core/assets/vendor/jquery/jquery.js
    @@ -1331,7 +1331,7 @@ setDocument = Sizzle.setDocument = function( node ) {
    -			// The test attribute must be unknown in Opera but "safe" for WinRT
    +      // The test attribute must be unknown in Opera but "safe" for WinRT
    
    @@ -6759,7 +6759,7 @@ function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computed
    -		// If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
    +    // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
    
    @@ -6909,7 +6909,7 @@ jQuery.extend( {
    -		// Gets hook for the prefixed version, then unprefixed version
    +    // Gets hook for the prefixed version, then un-prefixed version
    
    @@ -6978,7 +6978,7 @@ jQuery.extend( {
    -		// Try prefixed name followed by the unprefixed name
    +    // Try prefixed name followed by the un-prefixed name
    

    Unexpected changes to indentation

  2. +++ b/core/lib/Drupal/Core/Entity/EntityTypeInterface.php
    @@ -527,7 +527,7 @@ public function getBaseTable();
    +   * this type or a custom entity reference field settings form may de-prioritize
    
    +++ b/core/lib/Drupal/Core/Render/Renderer.php
    @@ -259,7 +259,7 @@ protected function doRender(&$elements, $is_root_call = FALSE) {
    +    // Try to fetch the pre-rendered element from cache, replace any placeholders
    
    +++ b/core/modules/quickedit/js/editors/formEditor.es6.js
    @@ -224,11 +224,11 @@
               // Second, set the 'htmlForOtherViewModes' attribute, so that when this
    ...
    +          // field is re-rendered, the change can be propagated to other instances
    ...
               // Finally, set the 'html' attribute on the field model. This will cause
    
    +++ b/core/modules/quickedit/js/views/AppView.es6.js
    @@ -522,7 +522,7 @@
    +        // necessary. So: only update the state of this field when the re-rendering
    
    +++ b/core/modules/quickedit/js/views/EntityToolbarView.es6.js
    @@ -39,19 +39,19 @@
    +        // Also re-render whenever a different field is highlighted or activated.
    
    +++ b/core/modules/quickedit/src/QuickEditController.php
    @@ -271,7 +271,7 @@ public function fieldForm(EntityInterface $entity, $field_name, $langcode, $view
    +   *   The view mode the field should be re-rendered in. Either an Entity Display
    
    +++ b/core/modules/search/src/Plugin/SearchIndexingInterface.php
    @@ -57,13 +57,13 @@ public function updateIndex();
    +   * this plugin for re-indexing, this method will be called. If this plugin uses
    
    +++ b/core/modules/search/src/SearchPageListBuilder.php
    @@ -369,7 +369,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
    +   * Form submission handler for the re-index button on the search admin settings
    
    +++ b/core/modules/serialization/src/Normalizer/FieldableEntityNormalizerTrait.php
    @@ -188,7 +188,7 @@ protected function getEntityTypeManager() {
    +   * and re-implementing its validation logic or its call to set the field value.
    
    +++ b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
    @@ -125,7 +125,7 @@ public function getForm(ViewEntityInterface $view, $display_id, $js) {
    +    // If the form has not been submitted, or was not set for re-rendering, stop.
    
    +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php
    @@ -244,7 +244,7 @@ public function testEntityStorageExceptionHandling() {
    +   * Tests that re-saving a revision with a different revision ID throws an exception.
    
    @@ -262,7 +262,7 @@ public function testUpdateWithRevisionId() {
    +   * Tests that re-saving an entity with a different entity ID throws an exception.
    
    +++ b/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php
    @@ -65,15 +65,15 @@ public function testSaveWorkflow() {
    +    // with a value containing the entity id, which implies a re-save. Check that
    
    +++ b/core/themes/claro/js/vertical-tabs.es6.js
    @@ -10,7 +10,7 @@
    + *    - The original Drupal.verticalTab object is built on the same (un-prefixed)
    

    Over 80 chars, or see #26.1

  3. 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 entries from Drupal's dictionary
deepak goyal’s picture

Assigned: Unassigned » deepak goyal
deepak goyal’s picture

Assigned: deepak goyal » Unassigned
Status: Needs work » Needs review
StatusFileSize
new108.76 KB
new16.28 KB

Hi @jungle
Made changes as you suggested please review.

longwave’s picture

Status: Needs review » Needs work

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.

I'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:

  1. +++ b/core/lib/Drupal/Core/Render/Renderer.php
    @@ -343,7 +343,7 @@ protected function doRender(&$elements, $is_root_call = FALSE) {
    -    //       https://www.drupal.org/node/2367555 lands.
    +    //   https://www.drupal.org/node/2367555 lands.
    
    @@ -614,7 +614,7 @@ protected function setCurrentRenderContext(RenderContext $context = NULL) {
    -   * - #cache: to cache the result of the placeholder
    +   * - #cache: to cache the result of the placeholder.
    
    @@ -647,7 +647,6 @@ protected function replacePlaceholders(array &$elements) {
         // @see https://www.drupal.org/node/2712935#comment-11368923
    -
         // First render all placeholders except 'status messages' placeholders.
    

    These reformatting changes are out of scope.

  2. +++ b/core/modules/jsonapi/src/JsonApiResource/ResourceIdentifier.php
    @@ -236,7 +236,7 @@ public static function compare(ResourceIdentifier $a, ResourceIdentifier $b) {
    -   * Deduplicates an array of ResourceIdentifier objects.
    +   * Duplicates an array of ResourceIdentifier objects.
    

    Deduplicates and duplicates are not the same.

  3. +++ b/core/modules/node/tests/src/Functional/PageViewTest.php
    @@ -17,7 +17,7 @@ class PageViewTest extends NodeTestBase {
    -   * Tests an anonymous and unpermissioned user attempting to edit the node.
    +   * Tests an anonymous and user without permission attempting to edit the node.
    

    This doesn't make sense any more. How about "Tests an anonymous user without permission..."

  4. +++ b/core/modules/quickedit/js/editors/formEditor.es6.js
    @@ -132,13 +132,13 @@
    -          // Reset an existing entry for this entity in the PrivateTempStore (if
    -          // any) when loading the field. Logically speaking, this should happen
    -          // in a separate request because this is an entity-level operation, not
    -          // a field-level operation. But that would require an additional
    -          // request, that might not even be necessary: it is only when a user
    -          // loads a first changed field for an entity that this needs to happen:
    -          // precisely now!
    +          // Reset an existing entry for this entity in the PrivateTempStore
    +          // (if any) when loading the field. Logically speaking, this should
    +          // happen in a separate request because this is an entity-level
    +          // operation, not a field-level operation. But that would require an
    +          // additional request, that might not even be necessary: it is only
    +          // when a user loads a first changed field for an entity that this
    +          // needs to happen: precisely now!
    

    This seems to be reformatting only, this is out of scope.

  5. +++ b/core/modules/quickedit/js/editors/formEditor.es6.js
    @@ -223,12 +223,12 @@
    -          // Second, set the 'htmlForOtherViewModes' attribute, so that when this
    -          // field is rerendered, the change can be propagated to other instances
    -          // of this field, which may be displayed in different view modes.
    +          // Second, set the 'htmlForOtherViewModes' attribute, so that when
    +          // this instances of this field, which may be displayed in different
    +          // view modes.
    

    Some words are missing here, this no longer makes sense.

  6. +++ b/core/modules/search/src/Plugin/SearchIndexingInterface.php
    @@ -57,13 +57,13 @@ public function updateIndex();
    +   * this plugin for re-indexing, this method will be called. If this plugin
    +   * uses the default search index, this method can call markForReindex($type)
    

    If we are changing reindexing to re-indexing, does the method need to be renamed markForReIndex()?

  7. +++ b/core/themes/claro/js/vertical-tabs.es6.js
    @@ -10,7 +10,8 @@
    - *    - The original Drupal.verticalTab object is built on the same (unprefixed)
    + *    - The original Drupal.verticalTab object is built on the same
    + *      (un-prefixed)
      *      CSS classes that should be used only for theming the component:
    

    This needs rewrapping.

jungle’s picture

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.

How 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

deepak goyal’s picture

Assigned: Unassigned » deepak goyal
deepak goyal’s picture

Assigned: deepak goyal » Unassigned
Status: Needs work » Needs review
StatusFileSize
new107.24 KB
new10.22 KB

Hi @longwave
Made changes please review.

jungle’s picture

Status: Needs review » Needs work
Issue tags: +Global2020

As 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.

  1. 
    ...
    +      // Do not allow changing the revision ID when re-saving the current
           // revision.
    ...
    +   * this type or a custom entity reference field settings form may
    +   * de-prioritize entities of this type in a select list.
    ...
    +    // Try to fetch the pre-rendered element from cache, replace any
    +    // placeholders and return the final markup.
    ...
        *   this account, and only in the context of the name used to login. For
        *   any other display purposes, use
    ...
    +   * Need to test saving and re-saving, because nested forms can cause issues
        * on the second save.
    ...
    +    // Mark one of the nodes for re-indexing, using the API function, and
         // verify indexing status.
    ...
    +  // core/authorize.php is an un-routed URL, so using the base: scheme is
       // the correct usage for this case.
    

    Wrapped too early

  2. .js and .css files should be generated. cd core && yarn && yarn build:js && yarn build:css
  3. Typos should be removed from the dictionary file core/misc/cspell/dictionary.txt. or re-generate the dictionary cd core && yarn && yarn spellcheck:make-drupal-dict
  4. Tagging "Global2020"
davidhernandez’s picture

It feels like each of these should be evaluated individually?

-   *   The unrouted URL assembler service.
+   *   The un-routed URL assembler service.

Unrouted is a valid word without hyphen.

-   *   An unsanitized database name.
+   *   An un-sanitized database name.

Unsanitized also appears in the dictionary without hyphen.

-      // Installing a module can cause a kernel boot therefore reinject all the
+      // Installing a module can cause a kernel boot therefore re-inject all the

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?

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

As we already made great progress here, and splitting this into child issues will lose all works almost --

I 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'.

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.

andregp’s picture

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 tags: +cspell error

Adding tag for the cspell spelling error issues.

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

Title: Fix flagged spelling errors due to missing hyphens for prefixes » [Meta] Fix flagged spelling errors due to missing hyphens for prefixes
Component: documentation » other
Status: Needs work » Active

Since #41 when the child issues were made, this became a meta.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.