ansible / team-devtools

Shared practices, workflows and decisions impacting Ansible devtools projects

Home Page:https://ansible.readthedocs.io/projects/team-devtools/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add spellchecking to our linting

ssbarnea opened this issue · comments

As we all make spell checking mistakes and typos which may not be visible during review, it makes sense to ensure that new changes are not introducing more.

Based on our available time we should look into improving our pre-commit hooks and add some spell checking to them.

Another reason for using a spellchecker is to ensure that we don't mix en-US with en-GB. While I am in UK, I expect that we will use the implicit en-US spelling like most of the industry (and tools).

AFAIK, there are at least two tools that can help here and they are not exclusive:

  • codespell which mostly looks for common programming typos and knows to suggest corrections, which is already used by most of devtools projects. Still its ability to spot problems is quite limited as it does not have an English dictionary DONE!
  • cspell which has support for multiple dictionaries, including technical ones, also well integrated with vscode.

Warning: Such a tool should not be enabled until we fix existing problems. Whoever takes the challenge of enabling it to a new repository must do preparatory work to fix existing problems. We do not want to impose rules that we do not already comply with in our codebase. We expect that some repositories may need a long chain of fixes as we still want to keep the pull-request to reasonably size.

Thanks @ssbarnea .

I especially appreciate the call out to clean-up ahead of time. IMO, it's the best way for everyone to see the benefit and improvements before introducing a new tool, and eliminate the possibility of introducing technical debt into a project with the assumption "Someone will clean it up later".

After few good months of using cspell on most of our repos, we can closing this approved. So far we found no real problems with it. We will use codespell in parallel on few repos as they do not fully overlap.