cspell job is not ignoring the word "d'essai"

Created on 2 October 2024, about 2 months ago

Problem/Motivation

The word d'essai is part of ignore list. The job is not ignoring it.
PR link - https://git.drupalcode.org/project/sitewide_alert/-/merge_requests/49
Failed job https://git.drupalcode.org/issue/sitewide_alert-3434618/-/jobs/2924433

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Component

gitlab-ci

Created by

🇮🇳India naveenvalecha New Delhi

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

Merge Requests

Comments & Activities

  • 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 page

    However, 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.php

    We 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.

  • Pipeline finished with Success
    about 2 months ago
    Total: 53s
    #301087
  • 🇬🇧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

  • Pipeline finished with Success
    about 1 month ago
    Total: 204s
    #307565
  • 🇬🇧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 file

    First 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/3032072

    Second, 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/3032123

    This 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.

  • Pipeline finished with Skipped
    about 1 month ago
    #309524
  • 🇪🇸Spain fjgarlin

    Merged. Thanks!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024