- Issue created by @naveenvalecha
- 🇬🇧United Kingdom jonathan1055
Hi naveenvalecha,
You could fix this by having just 'essai' in your ignore list. I know that is not the whole word, but it would be an easy way to solve the problem. - 🇬🇧United Kingdom jonathan1055
CSpell does allow words with apostrophes to be checked, if they are added into your projects's dictionary. The default file is
.cspell-project-words.txt
- see this gitlab templates documentation pageHowever, if you add the words via
_CSPELL_WORDS
then single and double quotes are removed from it, due to making it simpler for users not to have to quote each word individually in this bit of prepare-cspell.phpWe could look at making that better, say by allowing quotes to be escaped with a \ so you would enter
_CSPELL_WORDS: "behaviour, d\'essai, dismissabled ...
and the quote would not be removed. - 🇪🇸Spain fjgarlin
I think this is a non-issue and that we don't need to do any changes. Using just
essai
fixes the issue, which makes sense. - 🇬🇧United Kingdom jonathan1055
Yes, but it is our code that it removing the quote from the word. CSpell allows quotes in the middle of words, it is a perfectly valid thing to specifiy, but we are trashing it. I will have a look at a simple way to avoid that (feeling quilty as I wrote the lines of code that strip the quotes out :-)
- 🇪🇸Spain fjgarlin
Oh, I thought they were considered as two separate words. Happy for you to investigate on it. Maybe if there is a single quote, just treat the string as-is, otherwise continue doing what we are doing.
- Merge request !265#3478155 Quotes in CSpell and main module name sub-parts → (Merged) created by jonathan1055
- 🇬🇧United Kingdom jonathan1055
This is ready for review, but not urgent. In working on it, I found another problem which I have fixed. When getting the sub-modules, we already split the name into constituent parts (exploding on _ ) to add to the allowed words. But we did not do this for the main module name. I fixed that, but separated the changes into 3 commits for easier review.
@naveenvalecha
Would you like to help us test this MR? All you need to do is make two temporary changes in .gitlab-ci.yml in a merge request in you project:
Replace- project: $_GITLAB_TEMPLATES_REPO ref: $_GITLAB_TEMPLATES_REF
with
- project: issue/gitlab_templates-3478155 ref: 3478155-cspell-quotes
Then add
variables: _CURL_TEMPLATES_REPO: issue/gitlab_templates-3478155 _CURL_TEMPLATES_REF: 3478155-cspell-quotes
Or alternatively, you can test it via the 'Run pipeline' form.
More details about testing are on this doc page - 🇬🇧United Kingdom jonathan1055
I have done some testing on this, using
_CSPELL_WORDS="thisfileischecked, d'essai"
which is defined in the .gitlab-cil.yml file and it also has both of those words in the fileFirst the existing behaviour, not using this MR. We get
./.gitlab-ci.yml:20:12 - Unknown word (d'essai) -- # The word d'essai is here too. Suggestions: [dessai, dessau, Dessau, dress, desman] ./.gitlab-ci.yml:53:38 - Unknown word (d'essai) -- "thisfileischecked, d'essai" Suggestions: [dessai, dessau, Dessau, dress, desman]
We also see in the displayed .cspell.json
"words": [ "thisfileischecked", "dessai", ...
showing that an invalid non-word without the quote has been added to the allowed words.
The job is https://git.drupalcode.org/project/scheduler/-/jobs/3032072Second, switching to MR265 - the word with the quote is allowed, job passes, and we see in .cspell.json displayed in the log:
"words": [ "thisfileischecked", "d'essai", ...
showing that the correct word has been added.
Job https://git.drupalcode.org/project/scheduler/-/jobs/3032123This is ready for review
- 🇪🇸Spain fjgarlin
The code looks good. The test in #10 (thanks) and the downstream pipelines passing (https://git.drupalcode.org/issue/gitlab_templates-3478155/-/pipelines/30...) makes this RTBC.
-
fjgarlin →
committed 4c756e46 on main authored by
jonathan1055 →
Issue #3478155 by jonathan1055, fjgarlin, naveenvalecha: cspell job is...
-
fjgarlin →
committed 4c756e46 on main authored by
jonathan1055 →
Automatically closed - issue fixed for 2 weeks with no activity.