diff --git a/Makefile b/Makefile index 3422d0b38..cc93e472e 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,7 @@ unused_dep: typos: # cargo install typos-cli typos --write-changes openraft/ tests/ stores/memstore/ stores/rocksstore stores/sledstore examples/raft-kv-memstore/ examples/raft-kv-rocksdb/ + #typos --write-changes --exclude change-log/ --exclude change-log.md --exclude derived-from-async-raft.md # typos clean: diff --git a/README.md b/README.md index 1f90fe12c..6b0e6e570 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ For benchmark detail, go to the [./cluster_benchmark](./cluster_benchmark) folde - ✅ **Leader election**: by policy or manually([`trigger_elect()`][]). - ✅ **Non-voter(learner) Role**: refer to [`add_learner()`][]. -- ✅ **Log Compaction**(snapshot of state machine): by policy or manully([`trigger_snapshot()`]). +- ✅ **Log Compaction**(snapshot of state machine): by policy or manually([`trigger_snapshot()`]). - ✅ **Snapshot replication**. - ✅ **Dynamic Membership**: using joint membership config change. Refer to [dynamic membership](https://docs.rs/openraft/latest/openraft/docs/cluster_control/dynamic_membership/index.html) - ✅ **Linearizable read**: [`ensure_linearizable()`][]. diff --git a/examples/memstore/src/log_store.rs b/examples/memstore/src/log_store.rs index bbed1abe0..05a6ebacd 100644 --- a/examples/memstore/src/log_store.rs +++ b/examples/memstore/src/log_store.rs @@ -1,4 +1,4 @@ -//! Provide `LogStore`, which is a in-memory implementation of `RaftLogStore` for demostration +//! Provide `LogStore`, which is a in-memory implementation of `RaftLogStore` for demonstration //! purpose only. use std::collections::BTreeMap; diff --git a/macros/src/lib.rs b/macros/src/lib.rs index f5e7efd57..8183a4b72 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -19,7 +19,7 @@ use syn::Type; /// This proc macro attribute optionally adds `Send` bounds to a trait. /// /// By default, `Send` bounds will be added to the trait and to the return bounds of any async -/// functions defined withing the trait. +/// functions defined within the trait. /// /// If the `singlethreaded` feature is enabled, the trait definition remains the same without any /// added `Send` bounds. @@ -161,7 +161,7 @@ fn do_since(args: TokenStream, item: TokenStream) -> Result { ... }`, where `K` and `V` are tempalte +/// The template to expand is defined as `(K,V) => { ... }`, where `K` and `V` are template /// variables. /// /// - The template must contain at least 1 variable. diff --git a/macros/tests/since/expand/with_doc.expanded.rs b/macros/tests/since/expand/with_doc.expanded.rs index b793f6c52..795060993 100644 --- a/macros/tests/since/expand/with_doc.expanded.rs +++ b/macros/tests/since/expand/with_doc.expanded.rs @@ -1,7 +1,7 @@ /// Doc /// /// By default, `Send` bounds will be added to the trait and to the return bounds of any async -/// functions defined withing the trait. +/// functions defined within the trait. /// /// If the `singlethreaded` feature is enabled, the trait definition remains the same without any /// added `Send` bounds. diff --git a/macros/tests/since/expand/with_doc.rs b/macros/tests/since/expand/with_doc.rs index 33453ab75..84dd32539 100644 --- a/macros/tests/since/expand/with_doc.rs +++ b/macros/tests/since/expand/with_doc.rs @@ -1,7 +1,7 @@ /// Doc /// /// By default, `Send` bounds will be added to the trait and to the return bounds of any async -/// functions defined withing the trait. +/// functions defined within the trait. /// /// If the `singlethreaded` feature is enabled, the trait definition remains the same without any /// added `Send` bounds. diff --git a/openraft/src/docs/faq/faq.md b/openraft/src/docs/faq/faq.md index d2682770f..14d5a3892 100644 --- a/openraft/src/docs/faq/faq.md +++ b/openraft/src/docs/faq/faq.md @@ -7,7 +7,7 @@ - Openraft stores committed log id: See: [`RaftLogStorage::save_committed()`][]; - Openraft optimized `ReadIndex`: no `blank log` check: [`Linearizable Read`][]. - A restarted Leader will stay in Leader state if possible; -- Does not support single step memebership change. Only joint is supported. +- Does not support single step membership change. Only joint is supported. ## Observation and Management @@ -78,7 +78,7 @@ There are two ways to initialize a raft cluster, assuming there are three nodes, all 3 nodes, e.g. `n2.initialize(btreeset! {1,2,3})`. 2. Incremental method: - First, call `Raft::initialize()` on `n1` with configuraion containing `n1` + First, call `Raft::initialize()` on `n1` with configuration containing `n1` itself, e.g., `n1.initialize(btreeset! {1})`. Subsequently use `Raft::change_membership()` on `n1` to add `n2` and `n3` into the cluster. diff --git a/openraft/src/docs/upgrade_guide/upgrade-v08-v09.md b/openraft/src/docs/upgrade_guide/upgrade-v08-v09.md index 2e8631607..326d28dd2 100644 --- a/openraft/src/docs/upgrade_guide/upgrade-v08-v09.md +++ b/openraft/src/docs/upgrade_guide/upgrade-v08-v09.md @@ -44,7 +44,7 @@ Follow the following steps to update your application to pass compilation with v - `RaftNetwork::send_vote()` to `RaftNetwork::vote()`; - `RaftNetwork::send_install_snapshot()` to `RaftNetwork::install_snapshot()`; -- `asycn` traits in Openraft are declared with [`#[openraft-macros::add_async_trait]`][`openraft-macros`] attribute since 0.9. +- `async` traits in Openraft are declared with [`#[openraft-macros::add_async_trait]`][`openraft-macros`] attribute since 0.9. `#[async_trait::async_trait]` are no longer needed when implementing `async` trait. For example, upgrade 0.8 async-trait implementation diff --git a/openraft/src/engine/handler/replication_handler/append_membership_test.rs b/openraft/src/engine/handler/replication_handler/append_membership_test.rs index 94f90433d..a95e92020 100644 --- a/openraft/src/engine/handler/replication_handler/append_membership_test.rs +++ b/openraft/src/engine/handler/replication_handler/append_membership_test.rs @@ -96,7 +96,7 @@ fn test_leader_append_membership_for_leader() -> anyhow::Result<()> { #[test] fn test_leader_append_membership_update_learner_process() -> anyhow::Result<()> { - // When updating membership, voter progreess should inherit from learner progress, and + // When updating membership, voter progress should inherit from learner progress, and // learner process should inherit from voter process. If voter changes to // learner or vice versa. diff --git a/scripts/README.md b/scripts/README.md index d391fb7e6..4a89aa2a4 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -6,7 +6,7 @@ Build change log since a previous git-tag - Usage: `./scripts/build_change_log.py `: build since specified commit. - Install: `pip install -r requirements.txt`. -This script buils change log from git commit messages, outputs a versioned +This script builds change log from git commit messages, outputs a versioned change log to `./change-log/.md` and concatenates all versioned change log into `./change-log.md`. diff --git a/scripts/build_change_log.py b/scripts/build_change_log.py index 7f46eb62d..4752d0f82 100755 --- a/scripts/build_change_log.py +++ b/scripts/build_change_log.py @@ -311,12 +311,12 @@ def build_ver_changelog_summary(ver): # Remove existent summary try: - footer_indexs = lines.index(footer) + footer_indexes = lines.index(footer) except ValueError as e: print("No footer found") else: # skip `Detail:`, and a following blank line. - lines = lines[footer_indexs+2:] + lines = lines[footer_indexes+2:] # Build summary: # - Remove lines that starts with space, which is detail section, a list item @@ -344,7 +344,7 @@ def build_ver_changelog_summary(ver): # Remove suffix author l = re.sub('; by .*?$', '.', l) - # Remove redundent "." + # Remove redundant "." l = re.sub('[.][.]$', '.', l) # add indent: diff --git a/tests/tests/membership/t99_new_leader_auto_commit_uniform_config.rs b/tests/tests/membership/t99_new_leader_auto_commit_uniform_config.rs index cae48d9f5..5e3733bbd 100644 --- a/tests/tests/membership/t99_new_leader_auto_commit_uniform_config.rs +++ b/tests/tests/membership/t99_new_leader_auto_commit_uniform_config.rs @@ -54,7 +54,7 @@ async fn new_leader_auto_commit_uniform_config() -> Result<()> { let _ = log_index; - // To let tne router not panic + // To let the router not panic router.new_raft_node(1).await; router.new_raft_node(2).await; diff --git a/tests/tests/replication/t10_append_entries_partial_success.rs b/tests/tests/replication/t10_append_entries_partial_success.rs index a5573564f..5f316c094 100644 --- a/tests/tests/replication/t10_append_entries_partial_success.rs +++ b/tests/tests/replication/t10_append_entries_partial_success.rs @@ -25,7 +25,7 @@ async fn append_entries_partial_success() -> Result<()> { tracing::info!( log_index, - "--- set append-entries quota to {}, wirte {} entries", + "--- set append-entries quota to {}, write {} entries", quota, n );