Skip to content

Commit 240a36b

Browse files
Fix a typo, add CI check and typos config (#1)
1 parent 5148b94 commit 240a36b

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

.github/workflows/main.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ jobs:
6060
- name: Run clippy
6161
run: cargo clippy --all-features --all-targets -- -D warnings
6262

63+
# If this fails, consider changing your text or adding something to .typos.toml.
64+
typos:
65+
runs-on: ubuntu-latest
66+
steps:
67+
- uses: actions/checkout@v4
68+
- name: Check typos
69+
uses: crate-ci/[email protected]
70+
6371
build_result:
6472
name: Result
6573
runs-on: ubuntu-latest
@@ -68,11 +76,12 @@ jobs:
6876
- format
6977
- clippy
7078
- msrv
79+
- typos
7180

7281
steps:
7382
- name: Success
7483
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
7584
run: exit 0
7685
- name: Failure
7786
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
78-
run: exit 1
87+
run: exit 1

.typos.toml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See the configuration reference at
2+
# https://github.com/crate-ci/typos/blob/master/docs/reference.md
3+
4+
# Corrections take the form of a key/value pair. The key is the incorrect word
5+
# and the value is the correct word. If the key and value are the same, the
6+
# word is treated as always correct. If the value is an empty string, the word
7+
# is treated as always incorrect.
8+
9+
# Match Identifier - Case Sensitive
10+
[default.extend-identifiers]
11+
colour = "color"
12+
13+
# Match Inside a Word - Case Insensitive
14+
[default.extend-words]
15+
16+
[files]
17+
# Include .github, .cargo, etc.
18+
ignore-hidden = false
19+
extend-exclude = [
20+
# /.git isn't in .gitignore, because git never tracks it.
21+
# Typos doesn't know that, though.
22+
"/.git",
23+
]

malloc_size_of_derive/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ fn test_struct() {
114114
assert_eq!(
115115
no_space.matches(&$e.replace(" ", "")).count(),
116116
$count,
117-
"counting occurences of {:?} in {:?} (whitespace-insensitive)",
117+
"counting occurrences of {:?} in {:?} (whitespace-insensitive)",
118118
$e,
119119
expanded
120120
)

0 commit comments

Comments
 (0)