Skip to content

Commit 52fdb00

Browse files
committed
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.
1 parent b87b21e commit 52fdb00

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

.github/workflows/github-action-checks.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,12 @@ jobs:
2020
with:
2121
fetch-depth: 2
2222
- run: scripts/diffcheck.sh
23+
Typo-Checks:
24+
name: "Typo Checks"
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout Actions Repository
28+
uses: actions/checkout@v4
29+
30+
- name: Check spelling
31+
uses: crate-ci/typos@master

.typos.toml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[default]
2+
extend-ignore-re = [
3+
# NOTE: use here for regex patterns
4+
"xpub.*",
5+
"xprv.*",
6+
"3.*", # address
7+
"5.*", # address
8+
"private_key .*",
9+
"privkey .*",
10+
"tt.*", # <tt> tags
11+
"code.*", # <code> tags
12+
"\\w*<sub>", # prefix for <sub> tags
13+
"OP_SUCCESSx|\\d+",
14+
"pay.*",
15+
"ser.*",
16+
"prefix.*",
17+
"value: .*",
18+
]
19+
20+
[default.extend-words]
21+
# NOTE: use here for false-positives
22+
anc = "anc"
23+
PSBT = "PSBT"
24+
ser = "ser"
25+
# Names
26+
Atack = "Atack"
27+
Meni = "Meni"
28+
Ono = "Ono"
29+
30+
[files]
31+
extend-exclude = [
32+
"/*/*.csv",
33+
"/*.d*",
34+
"/*/*.d*",
35+
"/*/*.go",
36+
"/*/*.json",
37+
"/*/*/*.json",
38+
"/*/*.mod",
39+
"/*/*.proto",
40+
"/*/*.py",
41+
"scripts",
42+
"/*/*.s*",
43+
"/*/*.t*",
44+
]

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Contributing Guidelines
2+
3+
Apart from following [BIP 2](./bip-0002.mediawiki),
4+
we do CI checks to ensure that the proposed BIPs do not have common typos.
5+
These checks are done using [`typos`](https://github.com/crate-ci/typos).
6+
To check for typos locally,
7+
install [`typos`](https://github.com/crate-ci/typos)
8+
and then run in the root directory:
9+
10+
```bash
11+
typos
12+
```

0 commit comments

Comments
 (0)