Uh oh!
There was an error while loading. Please reload this page.
Add typo checking for *.rst and *.md files - #10603
Conversation
Uh oh!
There was an error while loading. Please reload this page.
ulysses4ever
left a comment
There was a problem hiding this comment.
If we only use it for text files (e.g. RST) there's not much profit we get over conventional spell checkers like aspell? I think the killer feature of typos is that it tries to analyze source code and find typos in things like program_idenfitiars? If we don't use this feature, I'd rather we use something like aspell. But I won't block it on these grounds.
Besides RST, could we include MD and, most importantly, the contents of the changelog-d directory? That looks critical to me.
geekosaur
commented
Nov 28, 2024
Some of the clean-ups suggested it was finding typos in comments in source code, at least. Identifiers might be a harder problem if they affect API. |
philderbeast
commented
Nov 28, 2024
@ulysses4ever, I'm starting cautiously, doing only |
ulysses4ever
commented
Nov 28, 2024
I didn't say a word about I also suggest to add a constant in Makefile for the wildcards like |
philderbeast
commented
Nov 28, 2024
I found typos in |
geekosaur
commented
Nov 28, 2024
FWIW we usually catch them while compiling them into actual release notes. Ideally we identify them within PRs before they're merged. |
ulysses4ever
commented
Nov 29, 2024
This. |
Uh oh!
There was an error while loading. Please reload this page.
96f532d to
3d3a06bComparephilderbeast
commented
Nov 29, 2024
I've managed to get this working but want to propose it on a separate PR. |
5f4ca6c to
794284fComparephilderbeast
commented
Nov 29, 2024
This needs another review now that I've changed the way I'm passing files to the |
Uh oh!
There was an error while loading. Please reload this page.
ulysses4ever
commented
Nov 29, 2024
I also disagree with separate targets for .md and .rst. I think one target for spell checking is enough. |
philderbeast
commented
Nov 29, 2024
@ulysses4ever, there's one more pair I'd like to add in a separate PR, the |
I wouldn't be able to use the Combining the scans into one larger scan will noticeably slow things down; |
ulysses4ever
commented
Nov 30, 2024
I think one rule for all file types should be enough. Please, name the reasons you think it's not. If it's |
ulysses4ever
commented
Nov 30, 2024
I don't see a slowdown from combining. I see run times for three different queries. None of these numbers are sensible in CI (or, indeed, locally). |
The slowness of the larger scans is quite noticable (sensible), locally. Also I don't trust the configuration of |
ulysses4ever
commented
Nov 30, 2024
Can you show the numbers?
That's great, so lets use some more bash magic to exclude what we need to exclude, if necessary. Again, please, name reasons to not spell-check all desired files in one go? |
philderbeast
commented
Nov 30, 2024
You may not have seen those. I edited one of my previous posts in this thread, #10603 (comment), adding the run times. |
I'm already doing exclusion using a simple inverted grep pattern. Which files are being scanned can be seen by adding the $ git diff
diff --git a/Makefile b/Makefile
index e4749580a..257bd8070 100644
--- a/Makefile+++ b/Makefile@@ -278,7 +278,7 @@ FIND_NAMED := find . -type f -name
.PHONY: users-guide-typos
users-guide-typos: ## Find typos in users guide
- cd doc && $(FIND_NAMED) '*.rst' | xargs typos+ cd doc && $(FIND_NAMED) '*.rst' | xargs typos --files
.PHONY: users-guide-fix-typos
users-guide-fix-typos: ## Fix typos in users guide |
No, I did see those because I put the summary into my quote in #10603 (comment) These numbers are negligible. So far, I don't see a single reason for having separate make-rules for every file type. |
philderbeast
commented
Nov 30, 2024
I disagree. Right now |
philderbeast
commented
Nov 30, 2024
I understand your wish to keep the makefile small. I would like to wait on trying to have one |
Uh oh!
There was an error while loading. Please reload this page.
1d47063 to
cab2f42Compare- Add a typos action - Fix typos in *.rst - Split version and platform env variables - Add comments to typo makefile targets - Add a section on typos to README - Layout block quotation - Add typos to checks - Fix typos in release-notes/*.md - Fix typos in **/*.md - Extract typos to its own folder - Rename to .typos.toml - Use find, grep and xargs with typos - We have users-guide-typos and markdown-typos - Fix markdown typos - Typo in help comment for markdown-fix-typos - Trigger action pushing to master only - Add FIND_NAMED variable - Update target in doc/README for finding typos - Update prerequisite targets of checks PHONY target
cab2f42 to
6d8f0f3Comparephilderbeast
commented
Nov 30, 2024
Label merge+no rebase is necessary when the pull request is from an organisation. |
philderbeast
commented
Dec 5, 2024
Also fixes #10604. |
Fix#10601. Adds spell checking (finding typos) and fixing makefile targets with recipes using typos and an GitHub action that uses the makefile target (even though there is a canned action available for this).
Limited at the moment to checking and fixing spelling in
*.rstfiles (and*.mdfiles - requested at review). No configuration is required as yet. The default configuration can be viewed withtypos --dump-config -.Fixes the typos that
make typosfound withmake fix-typosexcept for the one with an ambiguous fix that I fixed by hand.Template B: This PR does not modify behaviour or interface
E.g. the PR only touches documentation or tests, does refactorings, etc.
Include the following checklist in your PR: