- Issue created by @jonathan1055
- Status changed to Needs review
3 months ago 3:02pm 9 September 2024 - 🇬🇧United Kingdom jonathan1055
First draft, ready for review. I have tested this locally and it does what is required.
To do this I used
./scripts/run-local-checks.sh
which also required the inclusion ofprepare-cspell.php
in that script. Initially I had the modified.cspell.json
but the changes did not seem to be respected. Then I realised that at the top of run-local-checks all the files in /assets/internal/ are copied to the project top folder, thus over-writing the modified .cspell.json. Running prepare-cspell.php inside run-local-checks.sh works fine and it means we can easily test any changes to the spelling process. - 🇬🇧United Kingdom jonathan1055
Test without this MR - cspell reports "commerceguys" in a patch on composer.json
https://git.drupalcode.org/project/scheduler/-/jobs/2698245Test with this MR - cspell passes. (The display of .cspell.json is for info, to show the *.patch. This is in the Scheduler after_script, not the gitlab job)
https://git.drupalcode.org/project/scheduler/-/jobs/2698527 - Status changed to Needs work
3 months ago 9:11am 10 September 2024 - 🇪🇸Spain fjgarlin
Why not just adding the
*.patch
to the$ignore_files
array? It'd be a one-line change and we introduced that variable for this purpose? - 🇬🇧United Kingdom jonathan1055
I thought about that initially, but the difference is that patch files should never be checked. You may want
_CSPELL_IGNORE_STANDARD_FILES: 0
for other reasons, but you would still not want patch files checked. Actually, the .svg files could be moved into the "never" list, as they contain plenty of words which will always fail. Likewise the '.*ignore' entry can be moved into the new array. - 🇬🇧United Kingdom jonathan1055
This issue can also be used to make another improvement that I've been meaning to suggest. I noted that the projects own .gitlab-ci.yml file is not being checked for spelling and I think it should do. I've added a spelling error and you can see that the job still passes. The log has
CSpell: Files checked: 49, Issues found: 0 in 0 files.
The next commit will show the spelling error and the job should fail.
- 🇬🇧United Kingdom jonathan1055
As intended the Check Code job detected the spelling error of "checkkk"
gitlab-ci.yml:4:52 - Unknown word (checkkk) -- demonstrate spelling checkkk Suggestions: [checkmk, check, checks, checky, check's] .gitlab-ci.yml:112:44 - Unknown word (shellcheck) -- apt-get install -y shellcheck Suggestions: [spellcheck, spellchecks, shellcheckrc, shellack, shellback] .gitlab-ci.yml:139:7 - Unknown word (shellcheck) -- shellcheck --version Suggestions: [spellcheck, spellchecks, shellcheckrc, shellack, shellback] .gitlab-ci.yml:140:7 - Unknown word (shellcheck) -- shellcheck scripts/*.sh || EXIT Suggestions: [spellcheck, spellchecks, shellcheckrc, shellack, shellback] CSpell: Files checked: 57, Issues found: 4 in 1 file.
The word 'shellcheck' is not reported locally when using
./scripts/run-local-checks.sh
and I think this is because we are not usingprepare-cspell.php
in "Check Code". That should be done, because it adds more of the standard dictionaries than we have specified in the project's .cspell.json file. - 🇬🇧United Kingdom jonathan1055
As expected, this has removed the unknown word "shellcheck" and we just get the one intended error
.gitlab-ci.yml:4:52 - Unknown word (checkkk) -- demonstrate spelling checkkk Suggestions: [checkmk, check, checks, checky, check's] CSpell: Files checked: 49, Issues found: 1 in 1 file.
https://git.drupalcode.org/issue/gitlab_templates-3473051/-/jobs/2785755
Ready for review, but no hurry as other things are more urgent.
- Status changed to Needs review
3 months ago 10:32am 19 September 2024 - Status changed to Needs work
3 months ago 10:35am 19 September 2024 - Status changed to Needs review
3 months ago 11:00am 19 September 2024 - 🇬🇧United Kingdom jonathan1055
Applied the suggestions, thanks. Needs review.
I thought it would be simpler to ignore the .env.example file here, as I know it fails spelling, but to fix it would cause an unnecessary conflict with MR242 (which is much more important that this issue of spelling) - 🇬🇧United Kingdom jonathan1055
Fewer files are being spell-checked here compared to when I run it locally. Then I realsied that we need to set
export _CSPELL_IGNORE_STANDARD_FILES=0
here.First test as-is, showing what we are checking
CSpell: Files checked: 49, Issues found: 0 in 0 files.
https://git.drupalcode.org/issue/gitlab_templates-3473051/-/jobs/2795873Now with not ignoring the extra files
CSpell: Files checked: 57, Issues found: 0 in 0 files.
https://git.drupalcode.org/issue/gitlab_templates-3473051/-/jobs/2795946This is important, because among the 8 extra files being checked now are 3 which we really do want to check - CHANGELOG.md, docs/jobs/composer.md and docs/jobs/phpstan.md (the other 5 are .cspell.json, .gitignore, composer.json, package.json and scripts/.gitignore)
- Status changed to RTBC
3 months ago 2:14pm 20 September 2024 - 🇪🇸Spain fjgarlin
Well spotted. I reviewed the code and it looks good. RTBC.
Thanks! -
fjgarlin →
committed 22072ba0 on main authored by
jonathan1055 →
Issue #3473051 by jonathan1055, fjgarlin: CSpell should never be run...
-
fjgarlin →
committed 22072ba0 on main authored by
jonathan1055 →
Automatically closed - issue fixed for 2 weeks with no activity.