Problem/Motivation

Spelling errors/typos throughout PHP comments in core.

Out of scope:

Proposed resolution

List of words corrected (by Vaplas using PhpStorm built-in spellchecker). NB: not a full grammar check.

Remaining tasks

None?

User interface changes

None.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#77 2829185-77.patch91.53 KBjofitz
#71 interdiff_67-70.txt1.37 KBanmolgoyal74
#71 2829185-70.patch92.2 KBanmolgoyal74
#67 2829185-67.patch92.71 KBanmolgoyal74
#66 2829185-66.patch92.71 KBanmolgoyal74
#65 2829185-65.patch91.99 KBjofitz
#65 interdiff-2989612-64-65.txt572 bytesjofitz
#64 2829185-64.patch91.43 KBjofitz
#60 interdiff-59-60.txt589 bytesAnonymous (not verified)
#60 2829185-60.patch95.92 KBAnonymous (not verified)
#59 interdiff-52-59.txt44.2 KBAnonymous (not verified)
#59 2829185-59.patch95.92 KBAnonymous (not verified)
#52 interdiff-45-52.txt903 bytesgaurav.kapoor
#52 2829185-52.patch60.78 KBgaurav.kapoor
#45 2829185-45.patch64.17 KBjofitz
#43 2829185-43.patch65.37 KBjofitz
#40 typo_error-2829185-40.patch608 bytesMunavijayalakshmi
#36 list_typos_33.txt2.42 KBAnonymous (not verified)
#33 interdiff_18-33.txt3.45 KBAnonymous (not verified)
#33 d82_and_d83-2829185-33.patch66.86 KBAnonymous (not verified)
#30 interdiff-d82_and_d83-18-29.txt11.32 KBAnonymous (not verified)
#29 interdiff-d83_only-18-29.txt885 bytesAnonymous (not verified)
#29 d83_only-2829185-29.patch2.27 KBAnonymous (not verified)
#29 interdiff-d83_only-18-29.txt885 bytesAnonymous (not verified)
#29 d82_and_d83-2829185-29.patch64.1 KBAnonymous (not verified)
#28 this_fixes_the_spelling_issue.patch634 bytesYasiru Nilan
#25 d83_only-2829185-18-25.png279.34 KBamit.drupal
#18 d83_only-2829185-18.patch1.41 KBAnonymous (not verified)
#18 d82_and_d83-2829185-18.patch50.74 KBAnonymous (not verified)
#15 interdiff-2829185-13-15.txt2.2 KBchipway
#15 2829185-15.patch52.15 KBchipway
#13 interdiff-12-13.txt833 bytesAnonymous (not verified)
#13 few_spelling_typos-2829185-13.patch52.95 KBAnonymous (not verified)
#12 interdiff-11-12.txt832 bytesAnonymous (not verified)
#12 few_spelling_typos-2829185-12.patch52.95 KBAnonymous (not verified)
#11 interdiff-9-11.txt924 bytesAnonymous (not verified)
#11 few_spelling_typos-2829185-11.patch52.83 KBAnonymous (not verified)
#9 few_spelling_typos-2829185-9.patch52.84 KBAnonymous (not verified)
#5 interdiff-3-5.txt11.07 KBAnonymous (not verified)
#5 few_spelling_typos-2829185-5.patch54.19 KBAnonymous (not verified)
#4 few_spelling_typos-2829185-4.patch54.14 KBmark_fullmer
#3 interdiff-2-3.txt18.25 KBAnonymous (not verified)
#3 few_spelling_typos-2829185-3.patch54.19 KBAnonymous (not verified)
#2 interdiff-1-2.txt27.14 KBAnonymous (not verified)
#2 few_spelling_typos-2829185-2.patch35.39 KBAnonymous (not verified)
few_spelling_typos.patch8.26 KBAnonymous (not verified)

Comments

Anonymous’s picture

vaplas created an issue. See original summary.

Anonymous’s picture

StatusFileSize
new35.39 KB
new27.14 KB
Anonymous’s picture

StatusFileSize
new54.19 KB
new18.25 KB

I think this is my maximum)

mark_fullmer’s picture

StatusFileSize
new54.14 KB

There were a few items missed in the last patch:

-                        // No sure it's enough for a magic code ....
+                        // Not sure it's enough for a magic code ....

should be *and*:

-     * rand remove double slashes.
+     * and remove double slashes.

Hyphenate user-specific:

- * submission, the contents of a shopping cart, or other user specific content
+ * submission, the contents of a shopping cart, or other user-specific content

Incorrect verb use:

-   * Registers that update functions got executed.
+   * Registers that update functions were executed.

Properly mark machine name of permissions in text with quotes

-      // Only users with either post comments or access comments permission can
+      // Only users with "post comments" or "access comments" permission can

More than 80 characters long:

-      // The first tab key press is tracked so that an announcement about tabbing
+      // The first tab key press is tracked so an announcement about tabbing

Add comma after introductory phrase:

-    // Prior to negotiation the override language should be the default
+    // Prior to negotiation, the override language should be the default

It's jQuery, not Jquery:

-/* Hide the default Jquery UI dialog close button. */
+/* Hide the default jQuery UI dialog close button. */

Use the verb "set" to match the setter method:

-    // Make the body field unlimited cardinality.
+    // Set the body field to unlimited cardinality.

Comma after introductory phrase & reduce prepositions:

-  // For backwards compatibility switch the visibility of the methods to public.
+  // For backwards compatibility, switch the method visibility to public.

Avoid newspaper headline speak:

-    // Page still accessible but there should not be menu link.
+    // Page is still accessible but there should be no menu link.

Style:

-    // to $_SERVER['REQEUST_URI'] and friends. Therefore it is necessary to
+    // to $_SERVER['REQUEST_URI'] and friends. It is therefore necessary to

Capitalize HTML:

- * Tests that the allowed html configurations are updated with attributes.
+ * Tests that the allowed HTML configurations are updated with attributes.

Hyphenate compound verb:

- * Example implementation of accept header based content negotiation.
+ * Example implementation of "accept header"-based content negotiation.

Avoid newspaper speak:

-    // Check original string.
+    // Check the original string.

Hyphenation:

-   * Should be a fully qualified class name that implements
+   * Should be a fully-qualified class name that implements

Offset letter in quotes:

-    // This is a Cyrillic character that looks something like a u. See
+    // This is a Cyrillic character that looks something like a "u". See
Anonymous’s picture

StatusFileSize
new54.19 KB
new11.07 KB

I do not know English, but #4 looks very well for me. Done. Thank you, @mark_fullmer!

Anonymous’s picture

Oh no, I did not see your patch, sorry. You are great!

darius.restivan’s picture

Status: Needs review » Reviewed & tested by the community

Spelling corrected.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 5: few_spelling_typos-2829185-5.patch, failed testing.

Anonymous’s picture

Status: Needs work » Needs review
StatusFileSize
new52.84 KB

Two typos gone with refactoring their files:

+++ b/core/modules/hal/tests/src/Kernel/EntityNormalizeTest.php
-    // set, the test fails because target_id => 0 is reserialized to NULL.
+    // set, the test fails because target_id => 0 is deserialized to NULL.

+++ b/core/modules/rest/src/Tests/PageCacheTest.php
-    // Create an entity programatically.
+    // Create an entity programmatically.
anavarre’s picture

+++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
@@ -531,7 +531,7 @@ protected function loadFromSharedTables(array &$values, array &$translations) {
+            // \Drupal\Core\Entity\Sql\TableMappingInterface:: getColumnNames()

Extra whitespace here.

Anonymous’s picture

StatusFileSize
new52.83 KB
new924 bytes

@anavarre, thanks!

Anonymous’s picture

Related issues: +#2818081: "unambuguously" sill is an unambiguous bug
StatusFileSize
new52.95 KB
new832 bytes

+1 typo for our issue. Good artists copy, great artists sill :)

Anonymous’s picture

StatusFileSize
new52.95 KB
new833 bytes

It seems I'm still lamer, and correctly not 'still', but 'silly' (Silly assignment). Sorry!

Status: Needs review » Needs work

The last submitted patch, 13: few_spelling_typos-2829185-13.patch, failed testing.

chipway’s picture

StatusFileSize
new52.15 KB
new2.2 KB

Thanks vaplas,
I add to re-roll the patch.
I removed thema.api.php change because another patch did a better previous (conflicting) change and wording seems ok for me.

I changed also EntityAutocomplete.php patch part because the point seems to be on correcting "unambuguously" in "unambiguously", and in the following text "still" would add no meaning while "silly" is ... silly (bad in comment) ;-).
- * matches the incoming input, and sill assign form errors otherwise.
+ * matches the incoming input, and assign form errors otherwise.

chipway’s picture

Status: Needs work » Needs review

Needs work -> needs review

Status: Needs review » Needs work

The last submitted patch, 15: 2829185-15.patch, failed testing.

Anonymous’s picture

Status: Needs work » Needs review
StatusFileSize
new50.74 KB
new1.41 KB

@chipway, thank you very match! I also found out that not everyone use the 8.3 for sites, despite Layouts in core. Therefore, for better sync, i isolated two typos, that appeared only in 8.3:

#1565972: Remove static caching of array in mapConditionOperator():

-   * In PostgreSQL, 'LIKE' is case-sensitive. ILKE should be used for
+   * In PostgreSQL, 'LIKE' is case-sensitive. ILIKE should be used for

#2684873: ConfigurableLanguageManager::getConfigOverrideLanguage() returns NULL:

-    // Prior to negiotiation the override language should be the default
+    // Prior to negotiation, the override language should be the default

Status: Needs review » Needs work

The last submitted patch, 18: d83_only-2829185-18.patch, failed testing.

chipway’s picture

Random test issues on XX are not related to this patch. See https://www.drupal.org/node/2832853.

Mainly concerning UpdatePathTestBase.php. See https://www.drupal.org/project/issues/drupal?text=random+fail+UpdatePath...
or ArgumentPlaceholderUpdatePathTest.php. See https://www.drupal.org/project/issues/drupal?text=random+fail+ArgumentPl...

chipway’s picture

All tests passed today. Lets review please.

5hawn’s picture

I just applied both: d83_only-2829185-18.patch and d82_and_d83-2829185-18.patch on a local fresh install of Drupal 8.3. I then did a git diff to see the changes and can verify the spelling changes are correct.

5hawn’s picture

Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 18: d83_only-2829185-18.patch, failed testing.

amit.drupal’s picture

StatusFileSize
new279.34 KB

Review Patch #18 -"d83_only-2829185-18.patch" the spelling changes are correct.
I think unused comment in core/modules/language/src/Config/LanguageConfigFactoryOverride.php file .
please refer screenshot

xjm’s picture

Title: Few spelling typos » Fix spelling errors in Drupal core comments
Issue tags: +Needs issue summary update
Parent issue: » #2622992: Run a spellchecker against core and fix all the errors in comments

Great work on this issue so far!

It seems like this is a lot more than a few spelling errors. :) Based on the core issue scope policy and the scope @catch and I identified in #2622992: Run a spellchecker against core and fix all the errors in comments, we should spellcheck all of core and fix all the straightfoward spelling errors in a single patch if possible.

It seems like this issue is on its way to accomplishing that. Can someone document what spellcheck method is being used, and document a summary of spelling errors in code comments before vs. after the patch?

Yasiru Nilan’s picture

StatusFileSize
new634 bytes

I'm new to here here is my little change.

Anonymous’s picture

Status: Needs work » Needs review
StatusFileSize
new64.1 KB
new885 bytes
new2.27 KB
new885 bytes

#20: @chipway, thanks for classification errors and promotion of the issue!
#22: @ws6shawn, thanks for review!
#25: @amit.drupal, thanks for offer, but I am not competent in the language of such a decision. Looks like remark 'Prior to negotiation' has sense.
#27: @xjm, thanks for pretty words! Unfortunately, I can not you happy new Spellchecker. All typos were found through a standard spellcheker tool of PhpStorm during procrastination (censor). And then tested by Google Translate.

document a summary of spelling errors in code comments before vs. after the patch

I can do it, if I see some example.

I don't know about idea run spellchecker, great! To tell the truth, I'm a little repented for creating this issue) I thought about the quick fix (as is the case of spelling typos in comment). But it turned out that I made a lot of inaccuracies, and other developers had to spend time on this adjustment (thanks again). They have also improved the comments going beyond typos. Maybe we should bring them into a separate patch. Example:

-      // Only users with either post comments or access comments permisison can
+      // Only users with "post comments" or "access comments" permission can

#28: @Yasiru Nilan, thanks for this offer. We have this fix already, but you can help with review few new typos (see interdiff files).
Proof for 8.3 only typo #2569119: Use Crypt::hashBase64(), not hash('crc32b') or sha1 for placeholder tokens:

-      // https://www.drupal.org/node/2562341. The placholder uses a fixed string
+      // https://www.drupal.org/node/2562341. The placeholder uses a fixed string
Anonymous’s picture

StatusFileSize
new11.32 KB

The last submitted patch, 29: d82_and_d83-2829185-29.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 29: d83_only-2829185-29.patch, failed testing.

Anonymous’s picture

StatusFileSize
new66.86 KB
new3.45 KB

d82_and_d83-2829185-29.patch - not correct (it has changes for only d83 too). Fix it + new typos.

Anonymous’s picture

Status: Needs work » Needs review

The last submitted patch, 28: this_fixes_the_spelling_issue.patch, failed testing.

Anonymous’s picture

Add a summary of spelling errors in code comments before vs. after the patch #33 (only orthography without grammar). Based on --word-diff + manual correct. Order by d82_and_d83, d83_only.

wturrell’s picture

Issue summary: View changes

Use standard issue summary template.

wturrell’s picture

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Munavijayalakshmi’s picture

StatusFileSize
new608 bytes

I found Typo error (The word 'messages' is misspelled as 'mesages'.) in FormValidationMessageOrderTest.php. Fixed the typo error and attached patch, please review.

cilefen’s picture

@Munavijayalakshmi Usually what we need in an issue contribution is to start with the prior working patch and add the new changes.

cilefen’s picture

Status: Needs review » Needs work

For #41 and being that a new problem was discovered, this needs work.

jofitz’s picture

Status: Needs work » Needs review
StatusFileSize
new65.37 KB

Patch no longer applies so re-rolled. Tried to correct the error mentioned in #40, but cannot find FormValidationMessageOrderTest.php or the string "mesages".

Status: Needs review » Needs work

The last submitted patch, 43: 2829185-43.patch, failed testing.

jofitz’s picture

Status: Needs work » Needs review
StatusFileSize
new64.17 KB

Now rolled against the correct version. And, as if by magic, I can now see (and correct) the typo identified in #40! Time to go home, methinks...

prash_98’s picture

Status: Needs review » Reviewed & tested by the community

Went through all the parts of the core and I think so that all the spelling errors have been corrected. So changing the status to RTBC.

xjm’s picture

xjm’s picture

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 45: 2829185-45.patch, failed testing.

jacobsanford’s picture

Status: Needs work » Reviewed & tested by the community

Patch still applies to HEAD. Retesting and back to RTBC as per #46.

cilefen’s picture

Status: Reviewed & tested by the community » Needs work

Nice work everybody. The first thing that I do when evaluating an issue is to make sure the patch is fixing the thing mentioned in the issue title.

As noted in #29, in addition to spelling fixes there are wording changes that are not necessarily grammar fixes. That is not a problem in itself, but we want to make sure we retain the meaning of the comments. Following are two examples I saw. I do not think there are many such changes in the patch.

  1. +++ b/core/modules/simpletest/src/TestBase.php
    @@ -27,7 +27,7 @@
    -  // For backwards compatibility switch the visbility of the methods to public.
    +  // For backwards compatibility, switch the method visibility to public.
    
  2. +++ b/core/modules/system/src/Tests/Session/SessionHttpsTest.php
    @@ -190,7 +190,7 @@ protected function getPathFromLocationHeader($https = FALSE, $response_code = 30
    -    // to $_SERVER['REQEUST_URI'] and friends. Therefore it is necessary to
    +    // to $_SERVER['REQUEST_URI'] and friends. It is therefore necessary to
    
gaurav.kapoor’s picture

StatusFileSize
new60.78 KB
new903 bytes

Patch in #45 failed to apply. Fixed it and improved it by taking suggestion in #51.

gaurav.kapoor’s picture

Status: Needs work » Needs review
prash_98’s picture

Status: Needs review » Reviewed & tested by the community

Even this patch applies well and also has passed all the tests. So changing to RTBC. Guess it works well.

cilefen’s picture

Status: Reviewed & tested by the community » Needs review

So that we can evaluate whether all comment typos are fixed, would someone please attach the list of allowed tech words that were added to the PHPStorm dictionary (Editor -> Spelling -> Accepted Words)? This way we can repeat the scan with and without the patch applied and we could review the list of accepted words.

Thank you!

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dawehner’s picture

@cilefen
How about committing it early but then file a follow up like #2972224: Add .cspell.json to automate spellchecking in Drupal core.

Anonymous’s picture

I tried several times to create a dictionary per #55, but PHPStorm just disgustingly works with the dictionary. I found the saved words in some jar file they were mixed with the code 😱.

Moreover, the mixing of the case of symbols is not supported. Example, you can not add 'PATCHing' to dictionary, and such cases are many.

In addition, the use of the dictionary is greatly reduced, because in the comments there are many modified words, or glued, but they should be so.

Maybe better simply creating an issue, where everyone will add nit typos (so they do not interfere with useful patches). And before minor release just make commit.


Rough reroll of #52 (just skip all conflicts) + few more cases + updated scope in IS.
Anonymous’s picture

StatusFileSize
new95.92 KB
new589 bytes
amietpatial’s picture

#60 looks good spelling mistakes corrected.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

anmolgoyal74’s picture

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

Also need to add changes from
#2989612 - Fix typos in Views UI module.

jofitz’s picture

Issue tags: -Needs reroll
StatusFileSize
new91.43 KB

Re-rolled.

jofitz’s picture

Status: Needs work » Needs review
StatusFileSize
new572 bytes
new91.99 KB

Added change from #2989612: Fix typos in Views UI module. (the other 2 out of 3 were already included).

anmolgoyal74’s picture

StatusFileSize
new92.71 KB

Due to some recent changes, patch does not apply:

error: patch failed: core/modules/simpletest/src/Tests/InstallationProfileModuleTestsTest.php:19
error: core/modules/simpletest/src/Tests/InstallationProfileModuleTestsTest.php: patch does not apply
anmolgoyal74’s picture

StatusFileSize
new92.71 KB

It would be better if this issue get fixed, otherwise we need to re-roll every another day.

longwave’s picture

+++ b/core/lib/Drupal/Core/Config/FileStorage.php
@@ -46,7 +46,7 @@ public function __construct($directory, $collection = StorageInterface::DEFAULT_
-    // internal statc caching of FileCache is used and thus avoids blowing up
+    // internal stat caching of FileCache is used and thus avoids blowing up

Is this supposed to be "static"? "stat" does make some sense when talking about files but not sure it was what was intended here.

wturrell’s picture

"Static": it's part of this issue and commit (but FWIW, I'd have guessed "state" before I looked that up…)

longwave’s picture

Status: Needs review » Needs work

Needs work based on #68/69

anmolgoyal74’s picture

Status: Needs work » Needs review
StatusFileSize
new92.2 KB
new1.37 KB
longwave’s picture

Status: Needs review » Reviewed & tested by the community

I checked all the fixes in the patch and they all look good to me.

As this is such a moving target I don't believe we will ever fix all the spelling in a single issue, so I think this should be committed now and followups can be opened for any new or existing spelling issues.

The last submitted patch, 64: 2829185-64.patch, failed testing. View results

The last submitted patch, 60: 2829185-60.patch, failed testing. View results

anmolgoyal74’s picture

@xjm @
Just want to check if any plans to commit this to the Drupal 8.7 DEV core ?

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Needs a reroll :(

error: core/modules/file/src/Tests/FileManagedFileElementTest.php: does not exist in index

That's become a PHPUnit based test now.

jofitz’s picture

Status: Needs work » Needs review
StatusFileSize
new91.53 KB

Re-rolled

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Double checked the reroll, all good.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This is a good moment to commit this patch. We have a followup to automate spellchecking in place. I t applies to 8.7.x and 8.6.x so patches will apply to both actively published branches. And the issue has been rtbc many times.

Committed and pushed 2dabd1de10 to 8.7.x and 6dfc00c0f4 to 8.6.x. Thanks!

  • alexpott committed 2dabd1d on 8.7.x
    Issue #2829185 by vaplas, Jo Fitzgerald, anmolgoyal74, chipway, gaurav....

Status: Fixed » Closed (fixed)

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