-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check typos in CI #1654
Check typos in CI #1654
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(but can also be run manually with workflow_dispatch)
Can you provide a cross-platform command to run this check manually?
Install typos ./*.mediawiki ./*.md ./**/*.mediawiki ./**/*.md EDIT: add a typo to any md or mediawiki file and see it being flagged |
Thanks! Tested.
@@ -1,4 +1,4 @@
-name: Check Typos
+name: GitHub Actions Check
on:
push:
branches:
@@ -8,6 +8,7 @@ on:
jobs:
typos:
+ name: "Spelling Checks"
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository |
8f4684c
to
657b6f7
Compare
Done, added a
Good idea! I've removed the new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thank you for proposing this and putting in the work!
@jonatack: could you take another look whether your change requests have been satisfactorily addressed? I’m not particularly familiar with CI stuff, so please feel free to merge if you feel confident that it’s ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT about simplifying running the linter with something like the following:
diff --git a/.github/workflows/github-action-checks.yml b/.github/workflows/github-action-checks.yml
index 3f1fce9..17f19c1 100644
--- a/.github/workflows/github-action-checks.yml
+++ b/.github/workflows/github-action-checks.yml
@@ -29,5 +29,3 @@ jobs:
- name: Check spelling
uses: crate-ci/typos@master
- with:
- files: ./*.mediawiki ./*.md ./**/*.mediawiki ./**/*.md
diff --git a/.typos.toml b/.typos.toml
index e645929..e81f41c 100644
--- a/.typos.toml
+++ b/.typos.toml
@@ -27,3 +27,5 @@ Atack = "Atack"
Meni = "Meni"
+[files]
+extend-exclude = ["/*/*.csv", "/*.d*", "/*/*.d*", "/*/*.go", "/*/*.json", "/*/*/*.json", "/*/*.mod", "/*/*.proto", "scripts", "/*/*.s*", "/*/*.t*"]
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 506a295..df6d947 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -8,5 +8,5 @@ install [`typos`](https://github.com/crate-ci/typos)
and then run in the root directory:
-typos ./*.mediawiki ./*.md ./**/*.mediawiki ./**/*.md
+typos
This seems to work better for me locally and it also allows debugging the linter with its built-in options like typos --files
.
Edit: about the commit order, it seems best to fix the typos before adding the linter, or in the same commit, as otherwise the commits after adding the linter are non-hygienic.
Great suggestions! Thanks! I incorporated them all. I also took the liberty of adding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@storopoli looks good to me (thanks!) A few nits follow. Let me know if you'd like to update for them or merge this pull as-is.
Edit: also suggest doing the spelling fixups in a single commit.
typos is a powerful source code spell checker. Adds a CI job that runs on every PR and push to master (but can also be run manually with workflow_dispatch) that checks for typos. Adds a config file .typos.toml that deals with false positives and only checks for top-level/one-level .mediawiki and .md files.
Addressed all the nits, sorry for the delay... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 52fdb00 (thanks!)
We could fill out the contributing guide a bit more.
typos
is a powerful source code spell checker.
Adds a CI job that runs on every PR and
push to master (but can also be run manually with
workflow_dispatch
) that checks for typos.Adds a config file
.typos.toml
that deals withfalse positives and only checks for top-level/one-level
.mediawiki
and.md
files. This config can be extendedquite easily with actual terms or regexes to whitelist
(false-positives)
Fixes some typos in several BIPs that were flagged locally by
typos
.