diff options
author | Jose Storopoli <jose@storopoli.io> | 2024-07-25 16:20:55 -0300 |
---|---|---|
committer | Jose Storopoli <jose@storopoli.io> | 2024-08-12 14:31:41 -0300 |
commit | 52fdb00b6d5844f48cb30b5c39b6fe23708281e4 (patch) | |
tree | 99f9430860e3cfc74d4be6fb42efc57bec6c6f55 | |
parent | b87b21e7c1f7ee1a1ff17f610da96fd9f6cd7780 (diff) |
ci: add typo checking
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.
-rw-r--r-- | .github/workflows/github-action-checks.yml | 9 | ||||
-rw-r--r-- | .typos.toml | 44 | ||||
-rw-r--r-- | CONTRIBUTING.md | 12 |
3 files changed, 65 insertions, 0 deletions
diff --git a/.github/workflows/github-action-checks.yml b/.github/workflows/github-action-checks.yml index 8a7d2ac..ad76317 100644 --- a/.github/workflows/github-action-checks.yml +++ b/.github/workflows/github-action-checks.yml @@ -20,3 +20,12 @@ jobs: with: fetch-depth: 2 - run: scripts/diffcheck.sh + Typo-Checks: + name: "Typo Checks" + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4 + + - name: Check spelling + uses: crate-ci/typos@master diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 0000000..15d831f --- /dev/null +++ b/.typos.toml @@ -0,0 +1,44 @@ +[default] +extend-ignore-re = [ + # NOTE: use here for regex patterns + "xpub.*", + "xprv.*", + "3.*", # address + "5.*", # address + "private_key .*", + "privkey .*", + "tt.*", # <tt> tags + "code.*", # <code> tags + "\\w*<sub>", # prefix for <sub> tags + "OP_SUCCESSx|\\d+", + "pay.*", + "ser.*", + "prefix.*", + "value: .*", +] + +[default.extend-words] +# NOTE: use here for false-positives +anc = "anc" +PSBT = "PSBT" +ser = "ser" +# Names +Atack = "Atack" +Meni = "Meni" +Ono = "Ono" + +[files] +extend-exclude = [ + "/*/*.csv", + "/*.d*", + "/*/*.d*", + "/*/*.go", + "/*/*.json", + "/*/*/*.json", + "/*/*.mod", + "/*/*.proto", + "/*/*.py", + "scripts", + "/*/*.s*", + "/*/*.t*", +] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..df6d947 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,12 @@ +# Contributing Guidelines + +Apart from following [BIP 2](./bip-0002.mediawiki), +we do CI checks to ensure that the proposed BIPs do not have common typos. +These checks are done using [`typos`](https://github.com/crate-ci/typos). +To check for typos locally, +install [`typos`](https://github.com/crate-ci/typos) +and then run in the root directory: + +```bash +typos +``` |