From d130e126920e2f002f4996a4944ff5394e4369d2 Mon Sep 17 00:00:00 2001 From: clearloop Date: Thu, 4 Apr 2024 02:12:11 +0800 Subject: [PATCH] ci(typos): run typos check weekly (#3858) Co-authored-by: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> --- .github/workflows/CI.yaml | 3 +- .github/workflows/PR.yml | 9 +- .github/workflows/weekly.yml | 14 +++ Cargo.lock | 124 ++++++++++++------------- Cargo.toml | 2 +- Makefile | 6 +- _typos.toml | 7 +- common/src/gas_provider/node.rs | 2 +- gclient/src/api/listener/mod.rs | 2 +- runtime/vara/src/lib.rs | 2 +- scripts/gear.sh | 4 + scripts/src/test.sh | 13 +++ utils/gear-replay-cli/README.md | 2 +- utils/wasm-gen/src/config/generator.rs | 2 +- 14 files changed, 111 insertions(+), 81 deletions(-) create mode 100644 .github/workflows/weekly.yml diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 37d90b31545..9c14af6ffa2 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -4,7 +4,7 @@ on: schedule: - cron: "0 3 * * *" push: - branches: [ master ] + branches: [master] workflow_dispatch: concurrency: @@ -29,6 +29,7 @@ jobs: win-native: true release: true production: true + upload: if: github.event_name == 'push' && github.ref_name == 'master' runs-on: ubuntu-latest diff --git a/.github/workflows/PR.yml b/.github/workflows/PR.yml index 6a2b98aa0a2..54dd43d31cf 100644 --- a/.github/workflows/PR.yml +++ b/.github/workflows/PR.yml @@ -2,7 +2,7 @@ name: PR on: pull_request: - branches: [ master ] + branches: [master] concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -16,13 +16,6 @@ env: BINARYEN_VERSION: version_111 jobs: - typos: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: typos-action - uses: crate-ci/typos@master - status: runs-on: ubuntu-latest outputs: diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml new file mode 100644 index 00000000000..53765373f5c --- /dev/null +++ b/.github/workflows/weekly.yml @@ -0,0 +1,14 @@ +name: Weekly + +on: + schedule: + # Running this workflow weekly, see https://crontab.guru/#0_0_*_*_0 + - cron: "0 0 * * 0" + +jobs: + typos: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: typos-action + uses: crate-ci/typos@master diff --git a/Cargo.lock b/Cargo.lock index bbee79862cf..24bafd3112d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,7 +14,7 @@ dependencies = [ [[package]] name = "actor-system-error" -version = "1.2.0" +version = "1.2.1" dependencies = [ "derive_more", ] @@ -1219,7 +1219,7 @@ dependencies = [ [[package]] name = "calc-stack-height" -version = "1.2.0" +version = "1.2.1" dependencies = [ "anyhow", "env_logger", @@ -1879,7 +1879,7 @@ dependencies = [ [[package]] name = "crates-io" -version = "1.2.0" +version = "1.2.1" dependencies = [ "anyhow", "cargo_metadata 0.18.1", @@ -4123,14 +4123,14 @@ dependencies = [ [[package]] name = "galloc" -version = "1.2.0" +version = "1.2.1" dependencies = [ "gear-dlmalloc", ] [[package]] name = "gbuiltin-bls381" -version = "1.2.0" +version = "1.2.1" dependencies = [ "ark-bls12-381", "ark-ec", @@ -4143,7 +4143,7 @@ dependencies = [ [[package]] name = "gcli" -version = "1.2.0" +version = "1.2.1" dependencies = [ "anyhow", "async-trait", @@ -4186,7 +4186,7 @@ dependencies = [ [[package]] name = "gclient" -version = "1.2.0" +version = "1.2.1" dependencies = [ "anyhow", "ark-bls12-381", @@ -4234,7 +4234,7 @@ dependencies = [ [[package]] name = "gcore" -version = "1.2.0" +version = "1.2.1" dependencies = [ "galloc", "gear-core-errors", @@ -4246,7 +4246,7 @@ dependencies = [ [[package]] name = "gear-authorship" -version = "1.2.0" +version = "1.2.1" dependencies = [ "demo-constructor", "env_logger", @@ -4318,7 +4318,7 @@ dependencies = [ [[package]] name = "gear-cli" -version = "1.2.0" +version = "1.2.1" dependencies = [ "clap 4.5.4", "frame-benchmarking", @@ -4349,7 +4349,7 @@ dependencies = [ [[package]] name = "gear-common" -version = "1.2.0" +version = "1.2.1" dependencies = [ "derive_more", "enum-iterator 1.5.0", @@ -4375,7 +4375,7 @@ dependencies = [ [[package]] name = "gear-common-codegen" -version = "1.2.0" +version = "1.2.1" dependencies = [ "quote", "syn 2.0.57", @@ -4383,7 +4383,7 @@ dependencies = [ [[package]] name = "gear-core" -version = "1.2.0" +version = "1.2.1" dependencies = [ "blake2-rfc", "byteorder", @@ -4409,7 +4409,7 @@ dependencies = [ [[package]] name = "gear-core-backend" -version = "1.2.0" +version = "1.2.1" dependencies = [ "actor-system-error", "blake2-rfc", @@ -4427,7 +4427,7 @@ dependencies = [ [[package]] name = "gear-core-errors" -version = "1.2.0" +version = "1.2.1" dependencies = [ "derive_more", "enum-iterator 1.5.0", @@ -4437,7 +4437,7 @@ dependencies = [ [[package]] name = "gear-core-processor" -version = "1.2.0" +version = "1.2.1" dependencies = [ "actor-system-error", "derive_more", @@ -4469,7 +4469,7 @@ dependencies = [ [[package]] name = "gear-key-finder" -version = "1.2.0" +version = "1.2.1" dependencies = [ "directories 5.0.1", "hex", @@ -4477,7 +4477,7 @@ dependencies = [ [[package]] name = "gear-lazy-pages" -version = "1.2.0" +version = "1.2.1" dependencies = [ "cfg-if", "derive_more", @@ -4497,7 +4497,7 @@ dependencies = [ [[package]] name = "gear-lazy-pages-common" -version = "1.2.0" +version = "1.2.1" dependencies = [ "gear-core", "num_enum", @@ -4506,7 +4506,7 @@ dependencies = [ [[package]] name = "gear-lazy-pages-interface" -version = "1.2.0" +version = "1.2.1" dependencies = [ "byteorder", "gear-common", @@ -4519,7 +4519,7 @@ dependencies = [ [[package]] name = "gear-node-loader" -version = "1.2.0" +version = "1.2.1" dependencies = [ "anyhow", "clap 4.5.4", @@ -4547,7 +4547,7 @@ dependencies = [ [[package]] name = "gear-node-testing" -version = "1.2.0" +version = "1.2.1" dependencies = [ "frame-benchmarking", "frame-support", @@ -4626,7 +4626,7 @@ dependencies = [ [[package]] name = "gear-runtime-common" -version = "1.2.0" +version = "1.2.1" dependencies = [ "frame-benchmarking", "frame-support", @@ -4651,7 +4651,7 @@ dependencies = [ [[package]] name = "gear-runtime-interface" -version = "1.2.0" +version = "1.2.1" dependencies = [ "byteorder", "gear-core", @@ -4669,7 +4669,7 @@ dependencies = [ [[package]] name = "gear-runtime-primitives" -version = "1.2.0" +version = "1.2.1" dependencies = [ "sp-core", "sp-runtime", @@ -4677,7 +4677,7 @@ dependencies = [ [[package]] name = "gear-sandbox" -version = "1.2.0" +version = "1.2.1" dependencies = [ "assert_matches", "gear-runtime-interface", @@ -4693,7 +4693,7 @@ dependencies = [ [[package]] name = "gear-sandbox-env" -version = "1.2.0" +version = "1.2.1" dependencies = [ "parity-scale-codec", "sp-debug-derive", @@ -4703,7 +4703,7 @@ dependencies = [ [[package]] name = "gear-sandbox-host" -version = "1.2.0" +version = "1.2.1" dependencies = [ "environmental", "gear-sandbox-env", @@ -4722,7 +4722,7 @@ dependencies = [ [[package]] name = "gear-service" -version = "1.2.0" +version = "1.2.1" dependencies = [ "frame-benchmarking", "frame-benchmarking-cli", @@ -4800,14 +4800,14 @@ dependencies = [ [[package]] name = "gear-stack-buffer" -version = "1.2.0" +version = "1.2.1" dependencies = [ "cc", ] [[package]] name = "gear-utils" -version = "1.2.0" +version = "1.2.1" dependencies = [ "env_logger", "gear-core", @@ -4843,7 +4843,7 @@ checksum = "bbfbfa701dc65e683fcd2fb24f046bcef22634acbdf47ad14724637dc39ad05b" [[package]] name = "gear-wasm-builder" -version = "1.2.0" +version = "1.2.1" dependencies = [ "anyhow", "cargo_metadata 0.18.1", @@ -4893,7 +4893,7 @@ dependencies = [ [[package]] name = "gear-wasm-instrument" -version = "1.2.0" +version = "1.2.1" dependencies = [ "derive_more", "enum-iterator 1.5.0", @@ -5061,7 +5061,7 @@ dependencies = [ [[package]] name = "gmeta" -version = "1.2.0" +version = "1.2.1" dependencies = [ "blake2-rfc", "derive_more", @@ -5075,7 +5075,7 @@ dependencies = [ [[package]] name = "gmeta-codegen" -version = "1.2.0" +version = "1.2.1" dependencies = [ "gmeta", "gstd", @@ -5088,7 +5088,7 @@ dependencies = [ [[package]] name = "gring" -version = "1.2.0" +version = "1.2.1" dependencies = [ "anyhow", "base64 0.21.7", @@ -5121,7 +5121,7 @@ dependencies = [ [[package]] name = "gsdk" -version = "1.2.0" +version = "1.2.1" dependencies = [ "anyhow", "base64 0.21.7", @@ -5177,7 +5177,7 @@ dependencies = [ [[package]] name = "gsdk-codegen" -version = "1.2.0" +version = "1.2.1" dependencies = [ "proc-macro2", "quote", @@ -5186,7 +5186,7 @@ dependencies = [ [[package]] name = "gstd" -version = "1.2.0" +version = "1.2.1" dependencies = [ "arrayvec 0.7.4", "bs58 0.5.1", @@ -5206,7 +5206,7 @@ dependencies = [ [[package]] name = "gstd-codegen" -version = "1.2.0" +version = "1.2.1" dependencies = [ "gstd", "proc-macro2", @@ -5217,11 +5217,11 @@ dependencies = [ [[package]] name = "gsys" -version = "1.2.0" +version = "1.2.1" [[package]] name = "gtest" -version = "1.2.0" +version = "1.2.1" dependencies = [ "colored", "demo-constructor", @@ -7573,7 +7573,7 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "numerated" -version = "1.2.0" +version = "1.2.1" dependencies = [ "derive_more", "env_logger", @@ -7906,7 +7906,7 @@ dependencies = [ [[package]] name = "pallet-gear" -version = "1.2.0" +version = "1.2.1" dependencies = [ "blake2-rfc", "demo-async", @@ -8005,7 +8005,7 @@ dependencies = [ [[package]] name = "pallet-gear-bank" -version = "1.2.0" +version = "1.2.1" dependencies = [ "frame-benchmarking", "frame-support", @@ -8023,7 +8023,7 @@ dependencies = [ [[package]] name = "pallet-gear-builtin" -version = "1.2.0" +version = "1.2.1" dependencies = [ "ark-bls12-381", "ark-ec", @@ -8069,7 +8069,7 @@ dependencies = [ [[package]] name = "pallet-gear-builtin-rpc" -version = "1.2.0" +version = "1.2.1" dependencies = [ "jsonrpsee 0.16.3", "pallet-gear-builtin-rpc-runtime-api", @@ -8081,7 +8081,7 @@ dependencies = [ [[package]] name = "pallet-gear-builtin-rpc-runtime-api" -version = "1.2.0" +version = "1.2.1" dependencies = [ "sp-api", "sp-core", @@ -8089,7 +8089,7 @@ dependencies = [ [[package]] name = "pallet-gear-debug" -version = "1.2.0" +version = "1.2.1" dependencies = [ "demo-vec", "env_logger", @@ -8124,7 +8124,7 @@ dependencies = [ [[package]] name = "pallet-gear-gas" -version = "1.2.0" +version = "1.2.1" dependencies = [ "env_logger", "frame-benchmarking", @@ -8152,7 +8152,7 @@ dependencies = [ [[package]] name = "pallet-gear-messenger" -version = "1.2.0" +version = "1.2.1" dependencies = [ "env_logger", "frame-benchmarking", @@ -8177,7 +8177,7 @@ dependencies = [ [[package]] name = "pallet-gear-payment" -version = "1.2.0" +version = "1.2.1" dependencies = [ "env_logger", "frame-benchmarking", @@ -8210,7 +8210,7 @@ dependencies = [ [[package]] name = "pallet-gear-proc-macro" -version = "1.2.0" +version = "1.2.1" dependencies = [ "proc-macro2", "quote", @@ -8219,7 +8219,7 @@ dependencies = [ [[package]] name = "pallet-gear-program" -version = "1.2.0" +version = "1.2.1" dependencies = [ "frame-support", "frame-system", @@ -8243,7 +8243,7 @@ dependencies = [ [[package]] name = "pallet-gear-rpc" -version = "1.2.0" +version = "1.2.1" dependencies = [ "gear-common", "gear-core", @@ -8259,7 +8259,7 @@ dependencies = [ [[package]] name = "pallet-gear-rpc-runtime-api" -version = "1.2.0" +version = "1.2.1" dependencies = [ "pallet-gear", "sp-api", @@ -8270,7 +8270,7 @@ dependencies = [ [[package]] name = "pallet-gear-scheduler" -version = "1.2.0" +version = "1.2.1" dependencies = [ "env_logger", "frame-benchmarking", @@ -8301,7 +8301,7 @@ dependencies = [ [[package]] name = "pallet-gear-staking-rewards" -version = "1.2.0" +version = "1.2.1" dependencies = [ "env_logger", "frame-benchmarking", @@ -8336,7 +8336,7 @@ dependencies = [ [[package]] name = "pallet-gear-staking-rewards-rpc" -version = "1.2.0" +version = "1.2.1" dependencies = [ "jsonrpsee 0.16.3", "pallet-gear-staking-rewards-rpc-runtime-api", @@ -8347,7 +8347,7 @@ dependencies = [ [[package]] name = "pallet-gear-staking-rewards-rpc-runtime-api" -version = "1.2.0" +version = "1.2.1" dependencies = [ "pallet-gear-staking-rewards", "sp-api", @@ -8355,7 +8355,7 @@ dependencies = [ [[package]] name = "pallet-gear-voucher" -version = "1.2.0" +version = "1.2.1" dependencies = [ "derive_more", "env_logger", @@ -13989,7 +13989,7 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "vara-runtime" -version = "1.2.0" +version = "1.2.1" dependencies = [ "const-str", "env_logger", diff --git a/Cargo.toml b/Cargo.toml index cd16eb5bb51..28ae1bd8eed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace.package] -version = "1.2.0" +version = "1.2.1" authors = ["Gear Technologies"] edition = "2021" license = "GPL-3.0" diff --git a/Makefile b/Makefile index d948806644e..161fe7f2725 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ show: @ ./scripts/gear.sh show .PHONY: pre-commit # Here should be no release builds to keep checks fast. -pre-commit: fmt clippy test check-runtime-imports +pre-commit: fmt typos clippy test check-runtime-imports .PHONY: check-spec check-spec: @@ -266,3 +266,7 @@ kill-rust: .PHONY: install install: @ cargo install --path ./node/cli --force --locked + +.PHONY: typos +typos: + @ ./scripts/gear.sh test typos diff --git a/_typos.toml b/_typos.toml index c2754eb7930..434de787b23 100644 --- a/_typos.toml +++ b/_typos.toml @@ -1,6 +1,6 @@ [default] extend-ignore-re = [ - "\\w{48,49}", + "\\w{48,52}", "\"hel\"" ] @@ -8,5 +8,6 @@ extend-ignore-re = [ extend-exclude = ["gsdk/src/metadata/generated.rs"] [default.extend-words] -# typo in sp-state-machine, won't fix here for now. -overlayed = "overlayed" +overlayed = "overlayed" # typo in sp-state-machine, won't fix. +ws = "ws" +dur = "dur" diff --git a/common/src/gas_provider/node.rs b/common/src/gas_provider/node.rs index 62ed24d0c0c..5ff9a0a959e 100644 --- a/common/src/gas_provider/node.rs +++ b/common/src/gas_provider/node.rs @@ -137,7 +137,7 @@ impl NodeLock { pub enum GasNode { /// A root node for each gas tree. /// - /// Usually created when a new gas-ful logic started (i.e., message sent). + /// Usually created when a new gasful logic started (i.e., message sent). External { id: ExternalId, multiplier: GasMultiplier, diff --git a/gclient/src/api/listener/mod.rs b/gclient/src/api/listener/mod.rs index 297a1fa8257..7dca065bbf8 100644 --- a/gclient/src/api/listener/mod.rs +++ b/gclient/src/api/listener/mod.rs @@ -57,7 +57,7 @@ impl From for DispatchStatus { impl DispatchStatus { /// Check whether `DispatchStatus` is - /// [`Success`](DispatchStatus::Success)ful. + /// [`Success`](DispatchStatus::Success). pub fn succeed(&self) -> bool { matches!(self, DispatchStatus::Success) } diff --git a/runtime/vara/src/lib.rs b/runtime/vara/src/lib.rs index 12bedaff9f6..ca1afbb022b 100644 --- a/runtime/vara/src/lib.rs +++ b/runtime/vara/src/lib.rs @@ -155,7 +155,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // The version of the runtime specification. A full node will not attempt to use its native // runtime in substitute for the on-chain Wasm runtime unless all of `spec_name`, // `spec_version`, and `authoring_version` are the same between Wasm and native. - spec_version: 1200, + spec_version: 1210, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/scripts/gear.sh b/scripts/gear.sh index 1a62efb4852..b46504f5757 100755 --- a/scripts/gear.sh +++ b/scripts/gear.sh @@ -317,6 +317,10 @@ case "$COMMAND" in header "Running time consuming tests" time_consuming_tests "$@"; ;; + typos) + header "Running typo tests" + typo_tests ;; + *) header "Unknown option: '$SUBCOMMAND'" test_usage diff --git a/scripts/src/test.sh b/scripts/src/test.sh index b33f9f2b70e..05c25934566 100755 --- a/scripts/src/test.sh +++ b/scripts/src/test.sh @@ -28,6 +28,7 @@ test_usage() { docs run doc tests validators run validator checks time-consuming run time consuming tests + typos run typo tests EOF } @@ -116,3 +117,15 @@ time_consuming_tests() { $CARGO test -p demo-fungible-token --no-fail-fast "$@" -- --nocapture --ignored $CARGO test -p gear-wasm-builder --no-fail-fast "$@" -- --nocapture --ignored } + +typo_tests() { + readonly COMMAND="typos" + readonly VERSION='typos-cli 1.20.3' + + # Install typos-cli if not exist or outdated. + if ! [ -x "$(command -v ${COMMAND})" ] || [ "$($COMMAND --version)" != "$VERSION" ]; then + cargo install typos-cli + fi + + typos +} diff --git a/utils/gear-replay-cli/README.md b/utils/gear-replay-cli/README.md index 7d2b8c52ea1..1e9a7d4116a 100644 --- a/utils/gear-replay-cli/README.md +++ b/utils/gear-replay-cli/README.md @@ -14,7 +14,7 @@ Advantages with respect to the Substrate' `try-runtime` are: - doesn't require enabling additional features; - works with the native Runtime (in case the `RuntimeVersion` is as the one of the on-chain Runtime) rendering debugging possible. -There are also some shortcomings though (which can easliy be fixed in later versions), like the fact it can only download state/block from the live chain and not use a local snapshot. +There are also some shortcomings though (which can easily be fixed in later versions), like the fact it can only download state/block from the live chain and not use a local snapshot.
diff --git a/utils/wasm-gen/src/config/generator.rs b/utils/wasm-gen/src/config/generator.rs index 9af069cdaeb..1777b7fa189 100644 --- a/utils/wasm-gen/src/config/generator.rs +++ b/utils/wasm-gen/src/config/generator.rs @@ -32,7 +32,7 @@ impl GearWasmGeneratorConfigBuilder { Self(GearWasmGeneratorConfig::default()) } - /// Defines memory pages confir for the gear wasm generator. + /// Defines memory pages config for the gear wasm generator. pub fn with_memory_config(mut self, mem_config: MemoryPagesConfig) -> Self { self.0.memory_config = mem_config;