Skip to content

Commit 5a7e66c

Browse files
committed
ci: Run typos for spellchecking
Copied from slog-rs/slog
1 parent db38852 commit 5a7e66c

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/workflows/spellcheck.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Checks spelling with typos
2+
# This has very few false positives, only checking for known misspellings (similar to codespell).
3+
# This action is based on https://github.com/crate-ci/typos/blob/master/docs/github-action.md
4+
name: Check Spelling
5+
on: [push, pull_request]
6+
7+
env:
8+
CLICOLOR: 1
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
typos:
15+
# Only run on PRs if the source branch is on someone else's repo
16+
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
17+
18+
name: Check spelling with typos
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Run typos (pinned version)
23+
uses: crate-ci/typos@v1.35.1

.typos.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[default]
2+
extend-ignore-re = [
3+
# support spellchecker directives (ideally this would be builtin)
4+
"(?Rm)^.*(#|//)\\s*spellchecker:ignore$",
5+
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on",
6+
]
7+
8+
[files]
9+
ignore-hidden = false
10+
extend-exclude = [
11+
".git", # needed because we set 'ignore-hidden'
12+
]
13+
14+
[default.extend-identifiers]
15+
# the 'short' identifier for error
16+
erro = "erro"
17+
ERRO = "ERRO"

0 commit comments

Comments
 (0)