CSPELL is checking recipes/readme.txt - change to run in project folder

Created on 10 February 2025, 3 months ago

Problem/Motivation

The CSPELL job currently runs in the top-level $CI_PROJECT_DIR directory, and we have to exclude 'web', 'vendor' and other directories as part of the prepare-cspell script. But now there is a new directory 'recipes' which by default is getting checked in the contrib cspell job. See this verbose output

Proposed resolution

Change cspell job to run from $CI_PROJECT_DIR/$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME
This is similar to what we have already done for phpstan and eslint, and are currently working on for phpcs in Add basepath parameter to PHP Code Sniffer Active

Remaining tasks

User interface changes

📌 Task
Status

Active

Component

gitlab-ci

Created by

🇬🇧United Kingdom jonathan1055

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jonathan1055
  • 🇬🇧United Kingdom jonathan1055

    Whilst making these changes to cspell, we can also use this issue to fix the error that when verbose -v is added in $_CSPELL_EXTRA this is also used in the second cspell command when we create the words file. So we get the verbose text saved to the $WORDS_FILE artifact which is unhelpful, and also gives the wrong count for number of words mis-spelled. The verbose output is not needed twice, so it should be easy to remove '-v' from $_CSPELL_EXTRA before calling the command for the second time.

  • 🇬🇧United Kingdom jonathan1055

    Also I note that build.env is being checked. This is not a file that is under the control of the project, so we should always skip this.

    The empty artifact file _cspell_updated_project_words.txt is being checked on the second run, and there is no need to include this either, as it is just confusing in the log.

  • 🇬🇧United Kingdom jonathan1055

    Another thing to check is whether all folders are being checked. I am sure this used to be the case, but this recent cspell job only checked 7 files at the top level. It hasCSPELL_SEARCH=$([[ $_CSPELL_EXTRA =~ "--dot" ]] && echo "{**,.**}" || echo "**") and the result is ** as expected. The src and tests folders are shown in the potential list of files but no files in them are checked.

    https://git.drupalcode.org/issue/scheduler_content_moderation_integratio...

Production build 0.71.5 2024