Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
We have added a spellcheck to Drupal core. The Postgres schema driver contains a number of SQL column and function names that are not English words and do not appear elsewhere in core.
Proposed resolution
Ignore the words when spellchecking and remove them from the dictionary.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#33 | 3154669-33.patch | 6.45 KB | longwave |
Comments
Comment #2
longwaveComment #3
longwaveMaybe an alternative option here is to use
cSpell:ignore
which should ignore these words for the file in question only, if my reading of the docs is correct.Comment #4
jungleAnother option is to ignore the whole file by adding the file path to "ignorePaths" of .cspell.json, The patch attached adopted this way which @alexpott did before.
Comment #5
longwaveFor me #4 is the wrong approach here. Ignoring entire files is OK when we don't have control over them, or want to ignore a large set of things such as the migration tests, but really we should spellcheck this file except for a small number of words.
Comment #6
jungleThen, let's go the way #2 did. run "spellcheck:make-drupal-dict" updated the dictionary, new words from recent commits probably and setting this to RTBC.
Comment #7
junglePatch re-rolled.
Comment #8
longwave"emtity" and "linktitle" do not appear in this file: #3155463: Fix spelling error in Drupal\filter\Plugin\migrate\process\FilterID::getSourceFilterType() will fix this
Comment #9
longwaveThis seems a bit cleaner to me than adding disable/enable everywhere; we list upfront in each file the words that will be ignored.
This might work better for the FilterID case as well.
Comment #10
jungleAs a reference: The doc of
cSpell:ignore
: https://github.com/streetsidesoftware/cspell/tree/master/packages/cspell...Using
cSpell:ignore
is cleaner than usingcSpell:enable/disable
and its variations.But it's harder to get rid of words if code were changed, and the word(s) should be removed from the ignored ones.
For maintainability, -1
Comment #11
jungleOr adding above to the line closing to where words show up the first time
Comment #12
longwave> Or adding above to the line closing to where words show up the first time
That's a better idea for maintainability, I think? Adding all these cSpell comment lines everywhere does feel a bit ugly but that seems a bit cleaner than disable/enable? NW to try this approach.
Comment #13
mohrerao CreditAttribution: mohrerao as a volunteer and at Srijan | A Material+ Company for Drupal India Association commented@longwave, @Jungle, I would say keeping few lines at the beginning of the file would be a good idea where in we can list the ignored words for that file. This will address the maintainability as well as clean code
Comment #14
mohrerao CreditAttribution: mohrerao as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedAdding a patch as per my suggestion in #13. Seeting to NR for review.
Comment #15
jungleRe #14: The patch in #14 is no difference with the patch #9 or it's a copy of the patch in #9.
Comment #16
mohrerao CreditAttribution: mohrerao as a volunteer and at Srijan | A Material+ Company for Drupal India Association commented@Jungle. Apologies for that. I was asking what if we add these specific words at the begininng of the file as per https://github.com/streetsidesoftware/cspell/tree/master/packages/cspell...?
I agree this would also have some maintainability issue if code were removed, but if new code is added which again uses these words, then we will have to keep repeating ignore or disable.
Thanks.
Comment #17
jungleWell. This way is accepted in #3155463: Fix spelling error in Drupal\filter\Plugin\migrate\process\FilterID::getSourceFilterType(), and @alexpott commented that it's better. But needs a reroll.
Comment #18
jameszhang023 CreditAttribution: jameszhang023 commentedComment #19
longwaveThanks for rerolling.
To be consistent with #3155463: Fix spelling error in Drupal\filter\Plugin\migrate\process\FilterID::getSourceFilterType() I think we should place the ignore lines after the namespace and use statements.
I also identified a number of other Postgres specific words in this file that can be ignored, some of which can also be removed from the dictionary. Finally we can also get rid of "nullaction" by renaming a variable.
Comment #20
jameszhang023 CreditAttribution: jameszhang023 commented@longwave, Thank you for the improvement.
Comment #21
longwaveWe can remove three more Postgres words and "simpletests" as well - 33 words in total now - if we consider the entire Postgres driver to be in scope here.
Comment #22
jungleconname
is ignored, but not being removed from the dictionary. Because it exists incore/tests/Drupal/Tests/Core/Database/Driver/pgsql/PostgresqlSchemaTest.php
.Fixing. Then 34 in total. As this is a less than 1KB change. Will back and set to RTBC once CI run finishes.
Comment #23
longwave@jungle thanks for catching that one!
Comment #24
jungleTesting is green. no CS violations. Setting to RTBC.
Comment #25
jungleComment #26
jungleComment #27
ravi.shankar CreditAttribution: ravi.shankar at OpenSense Labs commentedComment #28
ravi.shankar CreditAttribution: ravi.shankar at OpenSense Labs commentedI have added a reroll of patch #22.
Comment #29
longwaveComment #30
longwaveRerolled
Comment #31
quietone CreditAttribution: quietone as a volunteer commentedI read the IS and then skimmed the patch and was surprised to find that 'simpletests' and 'nullaction' are changed even though they are not PostgreSQL specific keywords. Since this patch is doing something different than stated in the IS the IS should be updated to state what this patch is actually doing. From my brief read it appears to be fixing all spelling errors in Core/Database/driver/pgsql and related tests.
Comment #32
junglesimpletests in comment
nullaction as a variable name.
Comment #33
longwaveRerolled, also improved title as per #31
Comment #34
daffie CreditAttribution: daffie commentedPatch was rerolled.
Comment #35
jungleThanks @longwave!
cspell:ignore used. Both
cSpell:ignore
andcspell:ignore
are valid, and have usages committed. Needs a follow-up to unify them to keep consistent? Tagging "Needs followup"Comment rewritting.
Variable renaming
All are good to me.
Comment #37
catchCommitted c1e8435 and pushed to 9.1.x. Thanks!
Comment #39
quietone CreditAttribution: quietone at PreviousNext commentedFollow up made, #3305090: Should core use cspell or cSpell . Removing tag