readthedocs.org icon indicating copy to clipboard operation
readthedocs.org copied to clipboard

Add codespell: config + action (to detect new typos) and make it fix a good number of them

Open yarikoptic opened this issue 1 year ago • 4 comments

codespell was used occasionally on some files, so not a new tool here. But now it would guard RTD from having typos introduced to begin with.

Note that some fixes could affect (fix) functionality.

There is an odd "variable" syntaxt which I didn't fix since seems would require transition and smells like it is on purpose:

❯ git grep syntaxt -- readthedocs/
readthedocs/projects/migrations/0106_add_addons_config.py:                ("syntaxt", models.CharField(max_length=128)),
readthedocs/projects/models.py:    syntaxt = models.CharField(max_length=128)
readthedocs/projects/tasks/builds.py:        grab them by using glob syntaxt between other files that could be garbage.

or was it intended to be syntax ?

TODOs

  • [x] Remove TEMP commit intended to test if pre-commit catches the added malicious typo
  • [ ] Final decision on fixing or not CHANGELOG.rst
  • [ ] https://github.com/readthedocs/common/pull/212 needs to be merged first

:books: Documentation previews :books:

  • User's documentation (docs): https://docs--11195.org.readthedocs.build/en/11195/
  • Developer's documentation (dev): https://dev--11195.org.readthedocs.build/en/11195/

yarikoptic avatar Mar 07 '24 23:03 yarikoptic

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: readthedocs/api/v2/views/integrations.py

Function Unhandled Issue
get_closed_external_version_response TypeError: 'NoneType' object is not subscriptable /api/v2/webhook/{project_slug}/{integration_pk}...
Event Count: 1

Did you find this useful? React with a 👍 or 👎

sentry[bot] avatar Mar 07 '24 23:03 sentry[bot]

We use pre-commit for all other linting checks. I feel if we implement this it should be at pre-commit, not GHA.

agjohnson avatar Mar 08 '24 18:03 agjohnson

Hmm, interesting, my script should've detected presence of pre-commit config... Will have a look wherever get a chance. You do have ci job running the pre-commit I assume? (I don't see report from pre-commit service)

yarikoptic avatar Mar 08 '24 21:03 yarikoptic

that explains it:

❯ ls -ld .pre-commit-config.yaml
lrwxrwxrwx 1 yoh yoh 29 Mar  7 18:00 .pre-commit-config.yaml -> common/pre-commit-config.yaml
❯ cat .pre-commit-config.yaml
cat: .pre-commit-config.yaml: No such file or directory
❯ git submodule
-4af0fffd2cbeeb40f0a71b875beb99d6dc88a355 common

Let's do the submodules dance now...

yarikoptic avatar Mar 08 '24 22:03 yarikoptic