Enable cspell checking in Coder

Created on 4 August 2024, 5 months ago
Updated 15 September 2024, 3 months ago

Problem/Motivation

We have a couple of spelling mistakes in the code base and would like to avoid them in the future. Especially sniff names and error code names cause problems downstream in Drupal core and other projects where cspell checking is done:
🐛 Rename ColourDefinitionSniff to ColorDefinitionSniff Needs work
🐛 cspell complains about phpcs sniff name Active

Steps to reproduce

Run cspell.

Proposed resolution

* Enable cspell checking in our testing workflow in Github actions with https://github.com/marketplace/actions/cspell-action
* Ignore vendor folder and tests folder (for now).

Work started at https://github.com/pfrenssen/coder/pull/233

Remaining tasks

Finish pull request.

📌 Task
Status

Fixed

Version

8.3

Component

Coder Sniffer

Created by

🇦🇹Austria klausi 🇦🇹 Vienna

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

Comments & Activities

  • Issue created by @klausi
  • Status changed to Needs review 5 months ago
  • 🇦🇹Austria klausi 🇦🇹 Vienna

    PR ready: https://github.com/pfrenssen/coder/pull/233

    Places where we have misspelled sniffs and error codes - made ignore rules for them for now:
    * SeletorSingleLine
    * ColourDefinitionSniff
    * TeamplateSpacingAfterComment
    * UnecessaryFileDeclaration
    * TforValue
    * TrhowsCommentIndentation

  • 🇬🇧United Kingdom jonathan1055

    What is left to review here? It all looks OK, you have fixed the actual spelling errors in the Coder codebase.

    If the solution to the misspelled sniffs is to add those parts to the core dictionary, then when that is done the temporary 'ignore' rules you added can be removed. Or alternatively, you remove them now, so that we have visibility for these six, then when core is fixed it will be clean again. That will save doing another change later, but does mean we have to put up with the six bad spellings being reported until the core dictionary is fixed and a new release made.

  • 🇳🇿New Zealand quietone

    Just some comment about the case of 'cspell'.

    - name: Run Cspell
    This caught my eye because I don't recall seeing this casing. Shouldn't this be CSpell?

    There are two versions of 'cspell' in the ignore lines in the MR, # cspell:ignore Pieter Frenssen Welford and
    // Cspell:ignore TeamplateSpacingAfterComment .. In the CSpell docs for ignore lines the examples uses // cSpell:ignore

  • Status changed to Needs work 4 months ago
  • 🇬🇧United Kingdom jonathan1055

    Yes we need to be correct and consistent in the name of the job. I have seen CSpell being used most often, when referring to the product / software / job, and that is how they show it on their own site.

    In the CSpell docs for ignore lines the examples uses // cSpell:ignore

    Actually, that page has a whole raft of variations, you only saw the first one. cspell: and cSPELL: are all allowed. I think we should use all lower case in these comments, as that matched // phpcs:ignore etc.

  • Status changed to Fixed 4 months ago
  • 🇦🇹Austria klausi 🇦🇹 Vienna

    Fixed the upper case cspell and merged it, linked the other issue by accident in the commit.

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

Production build 0.71.5 2024