Skip to content

Commit c58f744

Browse files
authored
chore: introduce crate-ci/typos (#2430)
## Description Avoid having typos in the codebase. Closes #2396 ## Breaking Changes No. ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist - [ ] Self-review. - [ ] Documentation updates if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented.
1 parent 17c654e commit c58f744

File tree

24 files changed

+74
-35
lines changed

24 files changed

+74
-35
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,20 @@ jobs:
213213
- name: clippy check (default features)
214214
run: cargo clippy --workspace --all-targets
215215

216+
check_typos:
217+
timeout-minutes: 30
218+
name: Checking typos
219+
runs-on: ubuntu-latest
220+
env:
221+
RUSTC_WRAPPER: "sccache"
222+
SCCACHE_GHA_ENABLED: "on"
223+
steps:
224+
- uses: actions/checkout@v4
225+
- uses: taiki-e/install-action@v2
226+
with:
227+
tool: typos-cli
228+
- run: typos
229+
216230
msrv:
217231
if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')"
218232
timeout-minutes: 30

.typos.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[files]
2+
# We can't change the `CHANGELOG` without changing old commit message
3+
extend-exclude = [
4+
"CHANGELOG_old.md",
5+
"CHANGELOG.md"
6+
]
7+
8+
[default]
9+
extend-ignore-re = [
10+
# Line ignore with trailing `// spellchecker:disable-line`
11+
"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$",
12+
13+
# Abbreviations
14+
"UPnP",
15+
16+
# Library name
17+
"tung",
18+
19+
# Hex
20+
"ba",
21+
]
22+
23+
[default.extend-words]
24+
# Library name
25+
ratatui = "ratatui"

iroh-blobs/src/downloader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub trait Dialer: Stream<Item = (NodeId, anyhow::Result<Self::Connection>)> + Un
8787
pub enum FailureAction {
8888
/// The request was cancelled by us.
8989
AllIntentsDropped,
90-
/// An error ocurred that prevents the request from being retried at all.
90+
/// An error occurred that prevents the request from being retried at all.
9191
AbortRequest(anyhow::Error),
9292
/// An error occurred that suggests the node should not be used in general.
9393
DropPeer(anyhow::Error),

iroh-blobs/src/export.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub async fn export<D: BaoStore>(
3737
}
3838
}
3939

40-
/// Export all entries of a collection, recursively, to files on the local fileystem.
40+
/// Export all entries of a collection, recursively, to files on the local filesystem.
4141
pub async fn export_collection<D: BaoStore>(
4242
db: &D,
4343
hash: Hash,
@@ -55,7 +55,7 @@ pub async fn export_collection<D: BaoStore>(
5555
Ok(())
5656
}
5757

58-
/// Export a single blob to a file on the local fileystem.
58+
/// Export a single blob to a file on the local filesystem.
5959
pub async fn export_blob<D: BaoStore>(
6060
db: &D,
6161
hash: Hash,

iroh-blobs/src/store/bao_file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ impl Default for BaoFileStorage {
275275
impl BaoFileStorage {
276276
/// Take the storage out, leaving an empty storage in its place.
277277
///
278-
/// Be careful to put somethign back in its place, or you will lose data.
278+
/// Be careful to put something back in its place, or you will lose data.
279279
#[cfg(feature = "fs-store")]
280280
pub fn take(&mut self) -> Self {
281281
std::mem::take(self)

iroh-blobs/src/store/traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub trait BaoBatchWriter {
131131
/// Write a batch of bao content items to the underlying storage.
132132
///
133133
/// The batch is guaranteed to be sorted as data is received from the network.
134-
/// So leafs will be sorted by offset, and parents will be sorted by pre order
134+
/// So leaves will be sorted by offset, and parents will be sorted by pre order
135135
/// traversal offset. There is no guarantee that they will be consecutive
136136
/// though.
137137
///

iroh-dns-server/examples/publish.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ async fn main() -> Result<()> {
5858
s
5959
}
6060
Err(_) => {
61-
bail!("Environtment variable IROH_SECRET is not set. To create a new secret, use the --create option.")
61+
bail!("Environment variable IROH_SECRET is not set. To create a new secret, use the --create option.")
6262
}
6363
};
6464

iroh-dns-server/src/http/doh/extract.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub struct DnsQuery {
8080
/// Privacy setting for how your IP address is forwarded to authoritative nameservers
8181
#[allow(dead_code)]
8282
pub edns_client_subnet: Option<String>,
83-
/// Some url-safe random characters to pad your messages for privacy (to avoid being fingerprinted by encrytped message length)
83+
/// Some url-safe random characters to pad your messages for privacy (to avoid being fingerprinted by encrypted message length)
8484
#[allow(dead_code)]
8585
pub random_padding: Option<String>,
8686
/// Whether to provide answers for all records up to the root

iroh-docs/src/engine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ impl DefaultAuthorStorage {
379379
}
380380
}
381381

382-
/// Peristent default author for a docs engine.
382+
/// Persistent default author for a docs engine.
383383
#[derive(Debug)]
384384
pub struct DefaultAuthor {
385385
value: RwLock<AuthorId>,

iroh-docs/src/store/fs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ impl Store {
343343
})
344344
}
345345

346-
/// Delte an author.
346+
/// Delete an author.
347347
pub fn delete_author(&mut self, author: AuthorId) -> Result<()> {
348348
self.modify(|tables| {
349349
tables.authors.remove(author.as_bytes())?;
@@ -881,7 +881,7 @@ impl Iterator for ParentIterator {
881881
/// a database snapshot open until it is dropped.
882882
///
883883
/// Also, this represents a snapshot of the database at the time of creation.
884-
/// It nees a copy of a redb::ReadOnlyTable to be self-contained.
884+
/// It needs a copy of a redb::ReadOnlyTable to be self-contained.
885885
#[derive(derive_more::Debug)]
886886
pub struct ContentHashesIterator {
887887
#[debug(skip)]

0 commit comments

Comments
 (0)