From 408b91b942819eb167ae6c0dc4bf69be574b6052 Mon Sep 17 00:00:00 2001 From: Tavo Annus Date: Thu, 30 May 2024 11:52:03 +0300 Subject: [PATCH] Add typos check to CI --- .github/workflows/ci.yml | 12 +++++++++++- _typos.toml | 2 ++ io/zenoh-transport/tests/unicast_transport.rs | 2 +- zenoh/src/net/routing/hat/linkstate_peer/network.rs | 3 ++- zenoh/src/net/routing/hat/router/network.rs | 3 ++- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2aaf1b076..6320464db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -133,6 +133,16 @@ jobs: run: ci/valgrind-check/run.sh shell: bash + typos: + name: Typos Check + runs-on: ubuntu-latest + steps: + - name: Clone this repository + uses: actions/checkout@v4 + + - name: Check spelling + uses: crate-ci/typos@master + # NOTE: In GitHub repository settings, the "Require status checks to pass # before merging" branch protection rule ensures that commits are only merged # from branches where specific status checks have passed. These checks are @@ -141,7 +151,7 @@ jobs: ci: name: CI status checks runs-on: ubuntu-latest - needs: [check, test, valgrind] + needs: [check, test, valgrind, typos] if: always() steps: - name: Check whether all jobs pass diff --git a/_typos.toml b/_typos.toml index 6e4e05589..eb9952004 100644 --- a/_typos.toml +++ b/_typos.toml @@ -1,5 +1,7 @@ [files] extend-exclude = [ + # Ignore all files in transport tests as they contain + # hashes that are treated as typos. "io/zenoh-transport/tests/*.rs", ] diff --git a/io/zenoh-transport/tests/unicast_transport.rs b/io/zenoh-transport/tests/unicast_transport.rs index 33cfbceb1..4ddacef6b 100644 --- a/io/zenoh-transport/tests/unicast_transport.rs +++ b/io/zenoh-transport/tests/unicast_transport.rs @@ -41,7 +41,7 @@ use zenoh_transport::{ TransportPeerEventHandler, }; -// These keys and certificates below are purposedly generated to run TLS and mTLS tests. +// These keys and certificates below are purposely generated to run TLS and mTLS tests. // // With 2 way authentication (mTLS), using TLS 1.3, we need two pairs of keys and certificates: one // for the "server" and another one for the "client". diff --git a/zenoh/src/net/routing/hat/linkstate_peer/network.rs b/zenoh/src/net/routing/hat/linkstate_peer/network.rs index bb3ecd68c..7d6e3d285 100644 --- a/zenoh/src/net/routing/hat/linkstate_peer/network.rs +++ b/zenoh/src/net/routing/hat/linkstate_peer/network.rs @@ -890,7 +890,8 @@ impl Network { let indexes = self.graph.node_indices().collect::>(); let max_idx = indexes.iter().max().unwrap(); - let old_children: Vec> = self.trees.iter().map(|t| t.children.clone()).collect(); + let old_children: Vec> = + self.trees.iter().map(|t| t.children.clone()).collect(); self.trees.clear(); self.trees.resize_with(max_idx.index() + 1, || Tree { diff --git a/zenoh/src/net/routing/hat/router/network.rs b/zenoh/src/net/routing/hat/router/network.rs index c21d63d7d..e8e3a56aa 100644 --- a/zenoh/src/net/routing/hat/router/network.rs +++ b/zenoh/src/net/routing/hat/router/network.rs @@ -893,7 +893,8 @@ impl Network { let indexes = self.graph.node_indices().collect::>(); let max_idx = indexes.iter().max().unwrap(); - let old_children: Vec> = self.trees.iter().map(|t| t.children.clone()).collect(); + let old_children: Vec> = + self.trees.iter().map(|t| t.children.clone()).collect(); self.trees.clear(); self.trees.resize_with(max_idx.index() + 1, || Tree {