Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSpell: Add more words to the dictionary to avoid nagging in PRs #6255

Closed
klonos opened this issue Oct 7, 2023 · 31 comments · Fixed by backdrop/backdrop#4537, backdrop/backdrop#4575 or backdrop/backdrop#4578

Comments

@klonos
Copy link
Member

klonos commented Oct 7, 2023

Another iteration after #6047.

Most PRs I've been rebasing recently a tripping in the following files/lines/words:

core/includes/bootstrap.inc:1668:58 Unknown word (pageviews)
core/includes/diff.inc:1053:18 Unknown word (xbeg)
core/includes/diff.inc:1054:18 Unknown word (xlen)
core/includes/diff.inc:1055:18 Unknown word (ybeg)
core/includes/diff.inc:1056:18 Unknown word (ylen)
core/includes/diff.inc:1061:29 Unknown word (xbeg)
core/includes/diff.inc:1061:36 Unknown word (xlen)
core/includes/diff.inc:1061:43 Unknown word (ybeg)
core/includes/diff.inc:1061:50 Unknown word (ylen)
core/includes/diff.inc:1062:43 Unknown word (xbeg)
core/includes/diff.inc:1062:50 Unknown word (xlen)
core/includes/diff.inc:1062:57 Unknown word (ybeg)
core/includes/diff.inc:1062:64 Unknown word (ylen)
core/includes/diff.inc:1098:14 Unknown word (xbeg)
core/includes/diff.inc:1099:14 Unknown word (xlen)
core/includes/diff.inc:1100:14 Unknown word (ybeg)
core/includes/diff.inc:1101:14 Unknown word (ylen)
core/includes/diff.inc:1105:35 Unknown word (xbeg)
core/includes/diff.inc:1105:42 Unknown word (xlen)
core/includes/diff.inc:1105:49 Unknown word (ybeg)
core/includes/diff.inc:1105:56 Unknown word (ylen)
core/includes/mail.inc:12:45 Unknown word (WINDIR)
core/includes/menu.inc:1377:19 Unknown word (mlids)
core/includes/menu.inc:1477:34 Unknown word (mlids)
core/includes/session.inc:257:63 Unknown word (pageviews)
core/includes/unicode.inc:304:18 Unknown word (myverylongurlexample)
core/includes/unicode.inc:309:34 Unknown word (myverylongurl)
core/modules/book/book.module:690:4 Unknown word (mlids)
core/modules/book/book.module:692:8 Unknown word (mlids)
core/modules/book/book.module:695:28 Unknown word (mlids)
core/modules/file/file.field.inc:1094:48 Unknown word (WSOD)
core/modules/filter/tests/filter.test:1562:57 Unknown word (litererally)

Lets fix these, so that with a single rebase all other PRs can make cspell happy.

@klonos
Copy link
Member Author

klonos commented Oct 7, 2023

OK, cspell is not complaining now. The PR only needs a review - nothing to test: backdrop/backdrop#4537

@yorkshire-pudding
Copy link
Member

@klonos

core/modules/filter/tests/filter.test:1562:57 Unknown word (litererally)

https://github.com/backdrop/backdrop/blob/a2061c2082f35ef469fa4c3fc0419ab0eeb5bf09/core/modules/filter/tests/filter.test#L1560C1-L1562

I don't fully understand whether this actual typo ("litererally" vs "literally") is crucial to the test here, but if not, wouldn't it be better to correct the typo rather than add a typo to the dictionary?

@quicksketch
Copy link
Member

Looks like @klonos fixed the above typo. @indigoxela pointed out that we should probably use the comment syntax // cspell:ignore instead of /* cspell:ignore */. I pushed a commit to make that change to the PR.

I think this is ready to go and would be great to get our PRs cleaned-up.

@quicksketch
Copy link
Member

I merged backdrop/backdrop#4537 into 1.x and 1.26.x. Thanks @klonos and @indigoxela!

@klonos
Copy link
Member Author

klonos commented Oct 15, 2023

...more words started showing up in other PRs:

Warning: Unknown word (screenreaders)
core/modules/ckeditor/js/ckeditor.admin.js:109:100 Unknown word (screenreaders)
core/modules/ckeditor/js/ckeditor.admin.js:128:100 Unknown word (screenreaders)
core/modules/link/tests/link.ui.test:347:37 Unknown word (externa)
core/modules/locale/tests/locale.test:694:14 Unknown word (heure)
core/modules/locale/tests/locale.test:695:19 Unknown word (heures)
core/modules/locale/tests/locale.test:722:9 Unknown word (Ponedjeljak)
core/modules/locale/tests/locale.test:757:9 Unknown word (Ponedjeljak)
core/modules/locale/tests/locale.test:916:107 Unknown word (Svibanj)
core/modules/locale/tests/locale.test:932:87 Unknown word (Műveletek)
core/modules/locale/tests/locale.test:988:19 Unknown word (moutons)
core/modules/locale/tests/locale.test:1076:9 Unknown word (Svibanj)
core/modules/locale/tests/locale.test:1115:9 Unknown word (Műveletek)
core/modules/search/tests/search.test:1114:12 Unknown word (newstr)
core/modules/search/tests/search.test:1118:41 Unknown word (newstr)
core/modules/search/tests/search.test:1119:14 Unknown word (newstr)
core/modules/search/tests/search.test:1119:30 Unknown word (newstr)
core/modules/search/tests/search.test:1121:25 Unknown word (newstr)

Since this issue and the previous PR have been slated for 1.26.2, I'm reopening in order to file a follow-up PR to fix the above nagging...

@klonos
Copy link
Member Author

klonos commented Oct 15, 2023

New PR here: backdrop/backdrop#4544

@klonos
Copy link
Member Author

klonos commented Oct 18, 2023

...a few more words coming up here and there:

core/modules/search/tests/search.test:1119:14 Unknown word (newstr)
core/modules/search/tests/search.test:1119:30 Unknown word (newstr)
core/modules/search/tests/search.test:1121:25 Unknown word (newstr)
core/modules/simpletest/tests/form.test:1211:28 Unknown word (lowlevel)
core/modules/simpletest/tests/theme.test:284:16 Unknown word (parentlist)
core/modules/simpletest/tests/theme.test:298:20 Unknown word (childlist)
core/modules/simpletest/tests/theme.test:308:46 Unknown word (childlist)
core/modules/simpletest/tests/theme.test:315:27 Unknown word (parentlist)

@klonos
Copy link
Member Author

klonos commented Oct 18, 2023

...I've updated the PR:

  • instead of keep adding to dictionary, I've elected to fix the "unknown" words where they are used where applicable (provided they are contained within the file/functions that were flagged).
  • there's a warning re the visibility of a function not declared, but I thought best not scope creep PHPCS-related fixes into this PR

@klonos
Copy link
Member Author

klonos commented Nov 24, 2023

Thank you both @kiamlaluno and @bugfolder for taking the time to review, and for your suggestions. All but one are now resolved. The remaining one is the word unioned (lowercase - flagged by CSpell), with another 2 instances of it spelled like UNIONed (not flagged by CSpell) in the docblock for SelectQueryExtender::union() in core/includes/database/select.inc.

I chose to use an apostrophe, because I'm used to cc'ing and then cc'ed or cc'd both being used interchangeably by most people I have been interacting with in past (I have never bothered till now to check which one is the correct/proper), but after a quick research I found these:

So how do people feel about union'd then?

@bugfolder
Copy link

I see the situation of cc'd being different because cc is already an abbreviation, as opposed to union being an entire word. If we spelled it out, we'd say "carbon copied," not "carbon copy'd".

If "union" were a verb in everyday usage, then "unioned" would definitely be correct. It's not uncommon for technical languages to adapt common words for a specialized meaning, and per Grammarly, "Today, the following verbs-born-from-nouns are commonplace: cup, divorce, drink, dress, fool, host, intern, lure, medal, merge, model, mutter, pepper, salt, ship, sleep, strike, style, train, voice."

https://www.grammarly.com/blog/the-basics-of-verbing-nouns

Perhaps, though we should simply table this discussion. Then we can say that we've table'd it. 😉

@klonos
Copy link
Member Author

klonos commented Nov 24, 2023

I see the situation of cc'd being different because cc is already an abbreviation, as opposed to union being an entire word.

I think that you are spot on there @bugfolder 👍🏼 ...at the end of the day:

  1. This is a problem with CSpell flagging that as an unknown word. https://en.wiktionary.org/wiki/unioned for instance has it: https://en.wiktionary.org/wiki/unioned

    Verb
    unioned

    1. simple past and past participle of union
  2. I'd hate to delay this further for a single word that has a single instance in the lowercase format in our entire codebase. So, done! 😉

Final round of review please? 🙏🏼

@avpaderno
Copy link
Member

IMO, in the following sentence, neither intersected nor unioned makes the sentence clearer. They do not seem to add information necessary to understand the sentence.

Simplification: if we have both an (intersected) allowlist and a (unioned) denylist, then remove any tags from the allowlist that also exist in the denylist.

I would rather use this sentence.

Simplification: If we have both an allow list and a deny list, remove any tag from the allow list that also exists in the deny list.

(I would actually avoid to repeat allow list and deny list in the last clause.)

@bugfolder
Copy link

bugfolder commented Nov 24, 2023

I think I'd be in favor of just proceeding with the current PR, which fixes a slew of outstanding CSpell issues, and then we can take up whether to rewrite that particular sentence for clarity in a separate issue if it's warranted. It LGTM.

@klonos
Copy link
Member Author

klonos commented Nov 24, 2023

Yes @kiamlaluno, because we went back to unioned (which CSpell flags as unknown), I had to re-add that word back to our custom dictionary. So once this initial PR gets merged, we still have the task to cleanup our custom dictionary from odd words that are only used once or twice in our entire codebase, which includes the uninoned word. So, as @bugfolder mentioned, we'll definitely cycle back to this.

@quicksketch
Copy link
Member

I merged backdrop/backdrop#4575 into 1.x and 1.26.x. @klonos are you inclined to continue in this issue further? Or should we open new ones?

Thanks for all these meticulous updates!

@klonos
Copy link
Member Author

klonos commented Nov 24, 2023

First of all: yay! 🎉 ❤️

This issue, as its title denotes, was about adding words to the custom CSpell dictionary (which ended up being adding more in-built CSpell dictionaries as well). I don't think that there are any other words that need to be added, but please allow some time to rebase the PRs that were previously failing and confirm that. If there are more words to be added, then I believe that that should be done after #6280 is merged, and it should be done by adding them to the external dictionary.

The rest of the changes (those in the temporarily closed PR over at backdrop/backdrop#4544) are more of a clean-up of existing words rather than additions. So I think I'll file separate issues for those.

@klonos
Copy link
Member Author

klonos commented Nov 24, 2023

Quick, rather small (15 files, with no more than 5 straight-forward changes each) follow-up PR to address CSpell nags that came up after rebasing some PRs: backdrop/backdrop#4578

@quicksketch
Copy link
Member

Great, latest (hopefully last) PR has also been merged into 1.x and 1.26.x.

@klonos
Copy link
Member Author

klonos commented Nov 25, 2023

Lets keep this closed. I've filed #6302 for the cleanup of existing words in the dictionary, and we can use that for any odd new ones that happen to pop up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment