diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb2af3c383..293c867ec1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -450,3 +450,10 @@ jobs: continue-on-error: true run: | docker kill $(docker ps -q) + + codespell: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - run: pip install --user codespell[toml] + - run: codespell --ignore-words-list=ans,crate,inout,ratatui,ser,stayin,swarmin,worl --skip=CHANGELOG.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b9d83651cc..cb442bff59 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,7 +34,7 @@ Code contributions to Iroh are greatly appreciated. Here is the general workflow - **General code guidelines** - - When possible, please document relevant pieces of code following the [rust documentation conventions][docconventions]. For more information on how the rust documentation system works check the [rustdoc docummentation][rustdoc]. + - When possible, please document relevant pieces of code following the [rust documentation conventions][docconventions]. For more information on how the rust documentation system works check the [rustdoc documentation][rustdoc]. - Comment your code. It will be useful for your reviewer and future contributors. - **Pull request titles** diff --git a/iroh-dns-server/src/store.rs b/iroh-dns-server/src/store.rs index 7c9dc13ca2..2ae6fc7b8c 100644 --- a/iroh-dns-server/src/store.rs +++ b/iroh-dns-server/src/store.rs @@ -57,7 +57,7 @@ impl ZoneStore { Ok(Self::new(packet_store)) } - /// Configure a pkarr client for resolution of packets from the bittorent mainline DHT. + /// Configure a pkarr client for resolution of packets from the bittorrent mainline DHT. /// /// This will be used only as a fallback if there is no local info available. /// diff --git a/iroh-docs/src/engine.rs b/iroh-docs/src/engine.rs index a408df2793..78190ae921 100644 --- a/iroh-docs/src/engine.rs +++ b/iroh-docs/src/engine.rs @@ -393,7 +393,7 @@ pub struct DefaultAuthor { impl DefaultAuthor { /// Load the default author from storage. /// - /// If the storage is empty creates a new author and perists it. + /// If the storage is empty creates a new author and persists it. pub async fn load(storage: DefaultAuthorStorage, docs_store: &SyncHandle) -> Result { let value = storage.load(docs_store).await?; Ok(Self { diff --git a/iroh-net/bench/src/iroh.rs b/iroh-net/bench/src/iroh.rs index 5a85952b7f..a20d363384 100644 --- a/iroh-net/bench/src/iroh.rs +++ b/iroh-net/bench/src/iroh.rs @@ -81,7 +81,7 @@ pub fn transport_config(max_streams: usize, initial_mtu: u16) -> TransportConfig config.max_concurrent_uni_streams(max_streams.try_into().unwrap()); config.initial_mtu(initial_mtu); - // TODO: reenable when we upgrade quinn version + // TODO: re-enable when we upgrade quinn version // let mut acks = quinn::AckFrequencyConfig::default(); // acks.ack_eliciting_threshold(10u32.into()); // config.ack_frequency_config(Some(acks)); diff --git a/iroh-net/bench/src/quinn.rs b/iroh-net/bench/src/quinn.rs index b2c5e1c07b..f3895750bd 100644 --- a/iroh-net/bench/src/quinn.rs +++ b/iroh-net/bench/src/quinn.rs @@ -97,7 +97,7 @@ pub fn transport_config(max_streams: usize, initial_mtu: u16) -> TransportConfig config.max_concurrent_uni_streams(max_streams.try_into().unwrap()); config.initial_mtu(initial_mtu); - // TODO: reenable when we upgrade quinn version + // TODO: re-enable when we upgrade quinn version // let mut acks = quinn::AckFrequencyConfig::default(); // acks.ack_eliciting_threshold(10u32.into()); // config.ack_frequency_config(Some(acks)); diff --git a/iroh-net/src/dns.rs b/iroh-net/src/dns.rs index f8bf414c3e..81228b6db4 100644 --- a/iroh-net/src/dns.rs +++ b/iroh-net/src/dns.rs @@ -342,7 +342,7 @@ impl, B: Iterator> Iterator for Lookup /// Staggers calls to the future F with the given delays. /// /// The first call is performed immediately. The first call to succeed generates an Ok result -/// ignoring any previous error. If all calls fail, an error sumarizing all errors is returned. +/// ignoring any previous error. If all calls fail, an error summarizing all errors is returned. async fn stagger_call Fut, Fut: Future>>( f: F, delays_ms: &[u64], diff --git a/iroh-net/src/magicsock.rs b/iroh-net/src/magicsock.rs index 9db0c3fec7..0547953dc1 100644 --- a/iroh-net/src/magicsock.rs +++ b/iroh-net/src/magicsock.rs @@ -1554,7 +1554,7 @@ impl Stream for DirectAddrsStream { // When we start up we might initially have empty local endpoints as // the magic socket has not yet figured this out. Later on this set // should never be empty. However even if it was the magicsock - // would be in a state not very useable so skipping those events is + // would be in a state not very usable so skipping those events is // probably fine. // To make sure we install the right waker we loop rather than // returning Poll::Pending immediately here. diff --git a/iroh-net/src/netcheck/reportgen.rs b/iroh-net/src/netcheck/reportgen.rs index 3554af9dfa..81e48d3dd7 100644 --- a/iroh-net/src/netcheck/reportgen.rs +++ b/iroh-net/src/netcheck/reportgen.rs @@ -1339,7 +1339,7 @@ mod tests { node: Arc::new(relay), }; - // A singe ICMP packet might get lost. Try several and take the first. + // A single ICMP packet might get lost. Try several and take the first. let (tx, mut rx) = tokio::sync::mpsc::unbounded_channel(); let mut tasks = JoinSet::new(); for i in 0..8 { diff --git a/iroh-net/src/netcheck/reportgen/probes.rs b/iroh-net/src/netcheck/reportgen/probes.rs index 61c3a2140c..763c4ecda3 100644 --- a/iroh-net/src/netcheck/reportgen/probes.rs +++ b/iroh-net/src/netcheck/reportgen/probes.rs @@ -203,7 +203,7 @@ impl ProbePlan { let mut plan = Self(BTreeSet::new()); // The first time we need add probes after the STUN we record this delay, so that - // further relay server can re-use this delay. + // further relay server can reuse this delay. let mut max_stun_delay: Option = None; for relay_node in relay_map.nodes() { @@ -284,7 +284,7 @@ impl ProbePlan { let mut plan = Self(Default::default()); // The first time we need add probes after the STUN we record this delay, so that - // further relay servers can re-use this delay. + // further relay servers can reuse this delay. let mut max_stun_delay: Option = None; let had_stun_ipv4 = !last_report.relay_v4_latency.is_empty(); diff --git a/iroh-net/src/portmapper/pcp/protocol.rs b/iroh-net/src/portmapper/pcp/protocol.rs index 426de9d78a..de76f742a1 100644 --- a/iroh-net/src/portmapper/pcp/protocol.rs +++ b/iroh-net/src/portmapper/pcp/protocol.rs @@ -26,7 +26,7 @@ pub enum Version { } /// Opcode as defined in [RFC 6887 IANA Considerations](https://datatracker.ietf.org/doc/html/rfc6887#section-19) -// NOTE: PEER is not used, therefor not implemented. +// NOTE: PEER is not used, therefore not implemented. #[derive(Debug, Clone, Copy, PartialEq, Eq, IntoPrimitive, TryFromPrimitive)] #[repr(u8)] pub enum Opcode { diff --git a/iroh-net/src/tls/certificate.rs b/iroh-net/src/tls/certificate.rs index a31209f51b..8bfad4cd30 100644 --- a/iroh-net/src/tls/certificate.rs +++ b/iroh-net/src/tls/certificate.rs @@ -11,7 +11,7 @@ use x509_parser::prelude::*; use crate::key::{PublicKey, SecretKey, Signature}; /// The libp2p Public Key Extension is a X.509 extension -/// with the Object Identier 1.3.6.1.4.1.53594.1.1, +/// with the Object Identifier 1.3.6.1.4.1.53594.1.1, /// allocated by IANA to the libp2p project at Protocol Labs. const P2P_EXT_OID: [u64; 9] = [1, 3, 6, 1, 4, 1, 53594, 1, 1]; diff --git a/iroh/src/util/fs.rs b/iroh/src/util/fs.rs index d1af9650b0..d91416ef9d 100644 --- a/iroh/src/util/fs.rs +++ b/iroh/src/util/fs.rs @@ -130,7 +130,7 @@ pub async fn load_secret_key(key_path: PathBuf) -> anyhow::Result { let secret_key = SecretKey::generate(); let ser_key = secret_key.to_openssh()?; - // Try to canoncialize if possible + // Try to canonicalize if possible let key_path = key_path.canonicalize().unwrap_or(key_path); let key_path_parent = key_path.parent().ok_or_else(|| { anyhow::anyhow!("no parent directory found for '{}'", key_path.display())