Skip to content

Commit

Permalink
add(ci): spellcheck action (#234)
Browse files Browse the repository at this point in the history
WIP

---------

Co-authored-by: Javier Viola <363911+pepoviola@users.noreply.github.com>
  • Loading branch information
TomaszWaszczyk and pepoviola authored Jul 20, 2024
1 parent 125e41c commit d949f91
Show file tree
Hide file tree
Showing 13 changed files with 120 additions and 25 deletions.
50 changes: 50 additions & 0 deletions .config/lingua.dic
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
90

=
CLI
Deserialization
Deserialized
IFF
IPv4
JSON
NetworkNode
Ok
P2P
PjsResult
PoS
RPC
RUN_IN_CI
SDK
WASM
arg
args
chain_spec_command
cmd
declaratively
deserialize
deserialized
dir
env
fs
invulnerables
ip
js
k8s
msg
multiaddress
natively
ns
p2p
parachaing
pjs_rs
polkadot
polkadot_
rococo_local_testnet
rpc
serde_json
tgz
tmp
u128
u64
validator
ws
13 changes: 13 additions & 0 deletions .config/spellcheck.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[hunspell]
lang = "en_US"
search_dirs = ["."]
extra_dictionaries = ["lingua.dic"]
skip_os_lookups = true
use_builtin = true

[hunspell.quirks]
# `Type`'s
# 5x
transform_regex = ["^'([^\\s])'$", "^[0-9]+(?:\\.[0-9]*)?x$", "^'s$", "^\\+$", "[><+-]"]
allow_concatenation = true
allow_dashes = true
32 changes: 32 additions & 0 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Spellcheck

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
spellcheck:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Install cargo-spellcheck
run: |
sudo apt-get install libclang-dev
export LIBCLANG_PATH=/usr/lib/llvm-14/lib/
cargo install cargo-spellcheck
- name: Run cargo-spellcheck
run: cargo spellcheck
2 changes: 1 addition & 1 deletion crates/configuration/src/global_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct GlobalSettings {
#[serde(skip_serializing_if = "std::vec::Vec::is_empty", default)]
bootnodes_addresses: Vec<Multiaddr>,
// TODO: parse both case in zombienet node version to avoid renamed ?
/// Glocal spawn timeout
/// Global spawn timeout
#[serde(rename = "timeout")]
network_spawn_timeout: Duration,
// TODO: not used yet
Expand Down
2 changes: 1 addition & 1 deletion crates/configuration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//!
//! The main entry point of this crate is the [`NetworkConfigBuilder`] which is used to build a full network configuration
//! but all inners builders are also exposed to allow more granular control over the configuration.
//! but all inner builders are also exposed to allow more granular control over the configuration.
//!
//! **Note**: Not all options can be checked at compile time and some will be checked at runtime when spawning a
//! network (e.g.: supported args for a specific node version).
Expand Down
4 changes: 2 additions & 2 deletions crates/configuration/src/shared/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ impl NodeConfigBuilder<Buildable> {
}
}

/// Set the arguments that will be used when launching the node. OVerride the default.
/// Set the arguments that will be used when launching the node. Override the default.
pub fn with_args(self, args: Vec<Arg>) -> Self {
Self::transition(
NodeConfig {
Expand Down Expand Up @@ -592,7 +592,7 @@ impl NodeConfigBuilder<Buildable> {
}
}

/// Set the prometheus port that will be exposed for metrics. Uniqueness across config will be checked.
/// Set the Prometheus port that will be exposed for metrics. Uniqueness across config will be checked.
pub fn with_prometheus_port(self, prometheus_port: Port) -> Self {
match ensure_port_unique(prometheus_port, self.validation_context.clone()) {
Ok(_) => Self::transition(
Expand Down
4 changes: 2 additions & 2 deletions crates/orchestrator/src/network/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl NetworkNode {

// Metrics assertions

/// Get metric value 'by name' from prometheus (exposed by the node)
/// Get metric value 'by name' from Prometheus (exposed by the node)
/// metric name can be:
/// with prefix (e.g: 'polkadot_')
/// with chain attribute (e.g: 'chain=rococo-local')
Expand All @@ -151,7 +151,7 @@ impl NetworkNode {
self.metric(&metric_name).await
}

/// Assert on a metric value 'by name' from prometheus (exposed by the node)
/// Assert on a metric value 'by name' from Prometheus (exposed by the node)
/// metric name can be:
/// with prefix (e.g: 'polkadot_')
/// with chain attribute (e.g: 'chain=rococo-local')
Expand Down
16 changes: 8 additions & 8 deletions crates/orchestrator/src/network_spec/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ pub struct ParachainSpec {
/// Parachain id
pub(crate) id: u32,

/// Default command to run the node. Can be overriden on each node.
/// Default command to run the node. Can be overridden on each node.
pub(crate) default_command: Option<Command>,

/// Default image to use (only podman/k8s). Can be overriden on each node.
/// Default image to use (only podman/k8s). Can be overridden on each node.
pub(crate) default_image: Option<Image>,

/// Default resources. Can be overriden on each node.
/// Default resources. Can be overridden on each node.
pub(crate) default_resources: Option<Resources>,

/// Default database snapshot. Can be overriden on each node.
/// Default database snapshot. Can be overridden on each node.
pub(crate) default_db_snapshot: Option<AssetLocation>,

/// Default arguments to use in nodes. Can be overriden on each node.
/// Default arguments to use in nodes. Can be overridden on each node.
pub(crate) default_args: Vec<Arg>,

/// Chain-spec, only needed by cumulus based paras
Expand All @@ -49,7 +49,7 @@ pub struct ParachainSpec {
/// Registration strategy to use
pub(crate) registration_strategy: RegistrationStrategy,

/// Oboard as parachain or parathread
/// Onboard as parachain or parathread
pub(crate) onboard_as_parachain: bool,

/// Is the parachain cumulus-based
Expand All @@ -61,7 +61,7 @@ pub struct ParachainSpec {
/// Genesis state (head) to register the parachain
pub(crate) genesis_state: ParaArtifact,

/// Genesis wasm to register the parachain
/// Genesis WASM to register the parachain
pub(crate) genesis_wasm: ParaArtifact,

/// Genesis overrides as JSON value.
Expand Down Expand Up @@ -247,7 +247,7 @@ impl ParachainSpec {

/// Build parachain chain-spec
///
/// This fn customize the chain-spec (if is possible) and build the raw version
/// This function customize the chain-spec (if is possible) and build the raw version
/// of the chain-spec.
pub(crate) async fn build_chain_spec<'a, T>(
&mut self,
Expand Down
10 changes: 5 additions & 5 deletions crates/orchestrator/src/network_spec/relaychain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ pub struct RelaychainSpec {
/// Chain to use (e.g. rococo-local).
pub(crate) chain: Chain,

/// Default command to run the node. Can be overriden on each node.
/// Default command to run the node. Can be overridden on each node.
pub(crate) default_command: Option<Command>,

/// Default image to use (only podman/k8s). Can be overriden on each node.
/// Default image to use (only podman/k8s). Can be overridden on each node.
pub(crate) default_image: Option<Image>,

/// Default resources. Can be overriden on each node.
/// Default resources. Can be overridden on each node.
pub(crate) default_resources: Option<Resources>,

/// Default database snapshot. Can be overriden on each node.
/// Default database snapshot. Can be overridden on each node.
pub(crate) default_db_snapshot: Option<AssetLocation>,

/// Default arguments to use in nodes. Can be overriden on each node.
/// Default arguments to use in nodes. Can be overridden on each node.
pub(crate) default_args: Vec<Arg>,

// chain_spec_path: Option<AssetLocation>,
Expand Down
2 changes: 1 addition & 1 deletion crates/orchestrator/src/pjs_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub fn pjs_exec(code: String) -> Result<ReturnValue, anyhow::Error> {

/// pjs-rs success [Result] type
///
/// Represent the possible states returned from a succefully call to pjs-rs
/// Represent the possible states returned from a successfully call to pjs-rs
///
/// Ok(value) -> Deserialized return value into a [serde_json::Value]
/// Err(msg) -> Execution of the script finish Ok, but the returned value
Expand Down
4 changes: 2 additions & 2 deletions crates/orchestrator/src/spawner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ pub struct SpawnNodeCtx<'a, T: FileSystem> {
pub(crate) scoped_fs: &'a ScopedFilesystem<'a, T>,
/// Ref to a parachain (used to spawn collators)
pub(crate) parachain: Option<&'a ParachainSpec>,
/// The string represenation of the bootnode addres to pass to nodes
/// The string representation of the bootnode address to pass to nodes
pub(crate) bootnodes_addr: &'a Vec<String>,
/// Flag to wait node is ready or not
/// Ready state means we can query prometheus internal server
/// Ready state means we can query Prometheus internal server
pub(crate) wait_ready: bool,
}

Expand Down
4 changes: 2 additions & 2 deletions crates/provider/src/shared/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ pub const NODE_SCRIPTS_DIR: &str = "/scripts";
pub const LOCALHOST: IpAddr = IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1));
/// The port substrate listens for p2p connections on
pub const P2P_PORT: u16 = 30333;
/// The remote port prometheus can be accessed with
/// The remote port Prometheus can be accessed with
pub const PROMETHEUS_PORT: u16 = 9615;
/// The remote port websocket to access the RPC
pub const RPC_WS_PORT: u16 = 9944;
/// The remote port http to access the RPC
/// The remote port HTTP to access the RPC
pub const RPC_HTTP_PORT: u16 = 9933;
2 changes: 1 addition & 1 deletion crates/provider/src/shared/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub struct SpawnNodeOptions {
pub program: String,
/// Arguments to pass to the main command
pub args: Vec<String>,
/// Environment to set when runnning the `program`
/// Environment to set when running the `program`
pub env: Vec<(String, String)>,
// TODO: rename startup_files
/// Files to inject at startup
Expand Down

0 comments on commit d949f91

Please sign in to comment.