Add core flagWords even when project has a custom .cspell.json

Created on 27 May 2025, 9 days ago

Problem/Motivation

This is a follow-up to πŸ“Œ Add blacklist and whitelist to flagWords Active . When writing a response to a Coder issue here πŸ“Œ Rename GenderNeutralCommentSniff to InclusiveLanguageSniff and scan code and make wordlist configurable Active I found that there are currently 117 projects that have their own .cspell.json file so I would like to re-visit our decision not to add the flagWords into the config of those projects. My view is that this is an important-enough subject that we should make sure all projects get warnings if using the flagged words.

Proposed resolution

  • Add the core flagged words regardless of whether the project has their own custom .cpsell.json or not. This can be done via prepare-cspell.php, we do not need them in the assets file.
  • Provide a variable to turn this functionality off if the maintainer really decides they don't want it
  • This means that all projects get the new flagWords automatically, and have to make a conscious effort to turn off this feature. Then they are more likely to fix any occurence of the flagged words instead.

Remaining tasks

User interface changes

API changes

Data model 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 States cmlara

    -1,

    We chose to have our own config, gitlab_templates should not override us.

    If this is added it should be opt-in not opt-out (per the BC rule they no change should be made that breaks existing test runs).

    There is also a sample here or how a project that already has a cspell file can be referencing core without gitlab templates needing to be involved https://git.drupalcode.org/project/quasar_cspell/-/tree/main/docs/sample...

    found that there are currently 117 projects that have their own .cspell.json file

    I clicked a random one in the sample and found it implanting a variant of above to include cores dictionary.

    https://git.drupalcode.org/project/vertex_ai_search/-/blob/1.0.x/.cspell...

  • πŸ‡¬πŸ‡§United Kingdom jonathan1055

    Thanks for the above, and also for leaving your edit in strikethrough. That helps us to know from what angle you are approaching this, and I respsect your point of view about BC.

    So, given that these flagWords are not in a dictionary, but this work is part of a general advancement of the state of Drupal code, I would still suggest that it should be opt-out, not opt-in. Many of the projects that have their own cspell config are doing it for other reasons, not to avoid using core flagWords.

    It's good that we are having this discussion.

  • πŸ‡ΊπŸ‡ΈUnited States cmlara

    but this work is part of a general advancement of the state of Drupal code,

    I will note that Contrib is not Drupal code, each contrib project is its own unique environment, what is good for Core may not be best for contrib, the only ones who can make that decision is the individual maintainers (Note: I've not reviewed the new flagword list this is a general concept statement).

    This becomes more true when I look at the linked issue and it says "Many of these will have to be ignored, not fixed. So we could see an increase in the simple counts" as already and indicator that the change could be considered disruptive.

    Many of the projects that have their own cspell config are doing it for other reasons, not to avoid using core flagWords.

    This is true, however every single maintainer accepted that they would manually need to sync their lists when they deployed this file. I'm not against it as an opt-in.

    I would still suggest that it should be opt-out, not opt-in.

    For context:
    Yesterday I had a test fail, due to the changes I wasn't surprised and I attributed it to a change in PHPUnit that I would need to track down. Later another MR came in with a similar failure on a change I was not expecting to cause a test failure. My first thought after this second failure was "What did gitlab_templates change this time that my tests that passed a week ago no longer pass". It turned out that it was a legitimate failure, however that is the situation that gitlab_templates has left me in as a maintainer.

    It is only in typing this that I realize that means I no longer trust the tooling, that is a dangerous mindset for a maintainer to be in, and every time we make tests that cause failures we increase the burden on maintainers. This was why I pushed for the "any change that could cause a test that previously succeeded to fail" to be opt-in/major-only.

  • πŸ‡ͺπŸ‡ΈSpain fjgarlin

    I feel like we've been through this in the past already. Nobody is forcing you to use the tooling that we provide, that part is really opt-in.

    Also, you know that you can pin the version of the templates that you want/need, and then you won't get any changes: https://project.pages.drupalcode.org/gitlab_templates/info/templates-ver...

    So, if you choose not to do that, then you are choosing to stay up to date and receive the "defaults", which will change over time as core moves forward. Some people like this way, some people don't, and that's why you can choose.

  • πŸ‡ΊπŸ‡ΈUnited States cmlara

    Sadly it seems like we have.

    I likely just need to accept that there is no longer a β€œwe won’t break contrib” BC policy for gitlab_templates and avoid expressing those concerns going forward.

Production build 0.71.5 2024