Skip to content

Commit

Permalink
Fix a typo, add CI check and typos config (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys authored Jan 18, 2025
1 parent 5148b94 commit 240a36b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ jobs:
- name: Run clippy
run: cargo clippy --all-features --all-targets -- -D warnings

# If this fails, consider changing your text or adding something to .typos.toml.
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check typos
uses: crate-ci/typos@v1.29.4

build_result:
name: Result
runs-on: ubuntu-latest
Expand All @@ -68,11 +76,12 @@ jobs:
- format
- clippy
- msrv
- typos

steps:
- name: Success
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
run: exit 0
- name: Failure
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
run: exit 1
23 changes: 23 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See the configuration reference at
# https://github.com/crate-ci/typos/blob/master/docs/reference.md

# Corrections take the form of a key/value pair. The key is the incorrect word
# and the value is the correct word. If the key and value are the same, the
# word is treated as always correct. If the value is an empty string, the word
# is treated as always incorrect.

# Match Identifier - Case Sensitive
[default.extend-identifiers]
colour = "color"

# Match Inside a Word - Case Insensitive
[default.extend-words]

[files]
# Include .github, .cargo, etc.
ignore-hidden = false
extend-exclude = [
# /.git isn't in .gitignore, because git never tracks it.
# Typos doesn't know that, though.
"/.git",
]
2 changes: 1 addition & 1 deletion malloc_size_of_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn test_struct() {
assert_eq!(
no_space.matches(&$e.replace(" ", "")).count(),
$count,
"counting occurences of {:?} in {:?} (whitespace-insensitive)",
"counting occurrences of {:?} in {:?} (whitespace-insensitive)",
$e,
expanded
)
Expand Down

0 comments on commit 240a36b

Please sign in to comment.