Skip to content

Commit

Permalink
docs: fix typos discovered by codespell (#2534)
Browse files Browse the repository at this point in the history
## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->

% `codespell
--ignore-words-list=ans,crate,inout,ratatui,ser,stayin,swarmin,worl`
* https://github.com/codespell-project/codespell

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
  • Loading branch information
cclauss authored Jul 25, 2024
1 parent 2964569 commit 8435a45
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 13 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down
2 changes: 1 addition & 1 deletion iroh-dns-server/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
2 changes: 1 addition & 1 deletion iroh-docs/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self> {
let value = storage.load(docs_store).await?;
Ok(Self {
Expand Down
2 changes: 1 addition & 1 deletion iroh-net/bench/src/iroh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion iroh-net/bench/src/quinn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion iroh-net/src/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ impl<A: Iterator<Item = IpAddr>, B: Iterator<Item = IpAddr>> 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<T, F: Fn() -> Fut, Fut: Future<Output = Result<T>>>(
f: F,
delays_ms: &[u64],
Expand Down
2 changes: 1 addition & 1 deletion iroh-net/src/magicsock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion iroh-net/src/netcheck/reportgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions iroh-net/src/netcheck/reportgen/probes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Duration> = None;

for relay_node in relay_map.nodes() {
Expand Down Expand Up @@ -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<Duration> = None;

let had_stun_ipv4 = !last_report.relay_v4_latency.is_empty();
Expand Down
2 changes: 1 addition & 1 deletion iroh-net/src/portmapper/pcp/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion iroh-net/src/tls/certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
2 changes: 1 addition & 1 deletion iroh/src/util/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pub async fn load_secret_key(key_path: PathBuf) -> anyhow::Result<SecretKey> {
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())
Expand Down

0 comments on commit 8435a45

Please sign in to comment.