Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
WIP: CI: add spellcheck (#3421)
Browse files Browse the repository at this point in the history
* CI: add spellcheck

* revert me

* CI: explicit command for spellchecker

* spellcheck: edit misspells

* CI: run spellcheck on diff

* spellcheck: edits

* spellcheck: edit misspells

* spellcheck: add rules

* spellcheck: mv configs

* spellcheck: more edits

* spellcheck: chore

* spellcheck: one more thing

* spellcheck: and another one

* spellcheck: seems like it doesn't get to an end

* spellcheck: new words after rebase

* spellcheck: new words appearing out of nowhere

* chore

* review edits

* more review edits

* more edits

* wonky behavior

* wonky behavior 2

* wonky behavior 3

* change git behavior

* spellcheck: another bunch of new edits

* spellcheck: new words are koming out of nowhere

* CI: finding the master

* CI: fetching master implicitly

* CI: undebug

* new errors

* a bunch of new edits

* and some more

* Update node/core/approval-voting/src/approval_db/v1/mod.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

* Update xcm/xcm-executor/src/assets.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

* Apply suggestions from code review

Co-authored-by: Andronik Ordian <write@reusable.software>

* Suggestions from the code review

* CI: scan only changed files

Co-authored-by: Andronik Ordian <write@reusable.software>
  • Loading branch information
TriplEight and ordian committed Jul 14, 2021
1 parent 43920cd commit 8a6af44
Show file tree
Hide file tree
Showing 239 changed files with 929 additions and 763 deletions.
111 changes: 0 additions & 111 deletions .config/lingua.dic

This file was deleted.

16 changes: 14 additions & 2 deletions .gitlab-ci.yml
Expand Up @@ -164,6 +164,18 @@ check-runtime-benchmarks:
- ./scripts/gitlab/check_runtime_benchmarks.sh
- sccache -s

spellcheck:
stage: test
<<: *docker-env
<<: *rules-pr-only
script:
- cargo spellcheck --version
# compare with the commit parent to the PR, given it's from a default branch
- git fetch origin +${CI_DEFAULT_BRANCH}:${CI_DEFAULT_BRANCH}
- time cargo spellcheck check -vvv --cfg=scripts/gitlab/spellcheck.toml --checkers hunspell --code 1
-r $(git diff --name-only ${CI_COMMIT_SHA} $(git merge-base ${CI_COMMIT_SHA} ${CI_DEFAULT_BRANCH}))
allow_failure: true

build-adder-collator:
stage: test
<<: *collect-artifacts
Expand Down Expand Up @@ -383,9 +395,9 @@ trigger-simnet:
variables:
TRGR_PROJECT: ${CI_PROJECT_NAME}
TRGR_REF: ${CI_COMMIT_REF_NAME}
# simnet project ID
# Simnet project ID
DWNSTRM_ID: 332
script:
# API trigger for a simnet job, argument value is set in the project variables
# API trigger for a Simnet job, argument value is set in the project variables
- ./scripts/gitlab/trigger_pipeline.sh --simnet-version=${SIMNET_REF}
allow_failure: true
10 changes: 3 additions & 7 deletions README.md
@@ -1,6 +1,6 @@
# Polkadot

Implementation of a https://polkadot.network node in Rust based on the Substrate framework.
Implementation of a <https://polkadot.network> node in Rust based on the Substrate framework.

> **NOTE:** In 2018, we split our implementation of "Polkadot" from its development framework
> "Substrate". See the [Substrate][substrate-repo] repo for git history prior to 2018.
Expand All @@ -19,7 +19,7 @@ either run the latest binary from our
[releases](https://github.com/paritytech/polkadot/releases) page, or install
Polkadot from one of our package repositories.

Installation from the debian or rpm repositories will create a `systemd`
Installation from the Debian or rpm repositories will create a `systemd`
service that can be used to run a Polkadot node. This is disabled by default,
and can be started by running `systemctl start polkadot` on demand (use
`systemctl enable polkadot` to make it auto-start after reboot). By default, it
Expand Down Expand Up @@ -207,7 +207,7 @@ You can run a simple single-node development "network" on your machine by runnin
polkadot --dev
```

You can muck around by heading to https://polkadot.js.org/apps and choose "Local Node" from the
You can muck around by heading to <https://polkadot.js.org/apps> and choose "Local Node" from the
Settings menu.

### Local Two-node Testnet
Expand Down Expand Up @@ -246,7 +246,3 @@ Ensure you replace `ALICE_BOOTNODE_ID_HERE` with the node ID from the output of
## License

Polkadot is [GPL 3.0 licensed](LICENSE).

## Important Notice

https://polkadot.network/testnetdisclaimer
2 changes: 1 addition & 1 deletion bridges/.config/lingua.dic
Expand Up @@ -32,7 +32,7 @@ choosen
config/MS
crypto/MS
customizable/B
debian/M
Debian/M
decodable/MS
DOT/S
doesn
Expand Down
2 changes: 1 addition & 1 deletion bridges/.maintain/rialto-weight-template.hbs
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.

//! Autogenerated weights for {{pallet}}
//! Autogenerated weights for {{cmd.pallet}}
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}}
//! DATE: {{date}}, STEPS: {{cmd.steps}}, REPEAT: {{cmd.repeat}}
Expand Down
8 changes: 4 additions & 4 deletions bridges/bin/millau/runtime/src/lib.rs
Expand Up @@ -199,7 +199,7 @@ impl frame_system::Config for Runtime {
type BlockLength = bp_millau::BlockLength;
/// The weight of database operations that the runtime can invoke.
type DbWeight = DbWeight;
/// The designated SS58 prefix of this chain.
/// The designated `SS58` prefix of this chain.
type SS58Prefix = SS58Prefix;
/// The set code logic, just the default since we're not a parachain.
type OnSetCode = ();
Expand Down Expand Up @@ -239,7 +239,7 @@ parameter_types! {
}

impl pallet_timestamp::Config for Runtime {
/// A timestamp: milliseconds since the unix epoch.
/// A timestamp: milliseconds since the Unix epoch.
type Moment = u64;
type OnTimestampSet = Aura;
type MinimumPeriod = MinimumPeriod;
Expand Down Expand Up @@ -421,9 +421,9 @@ pub type Header = generic::Header<BlockNumber, Hashing>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
/// A Block signed with a Justification
pub type SignedBlock = generic::SignedBlock<Block>;
/// BlockId type as expected by this runtime.
/// `BlockId` type as expected by this runtime.
pub type BlockId = generic::BlockId<Block>;
/// The SignedExtension to the basic transaction logic.
/// The `SignedExtension` to the basic transaction logic.
pub type SignedExtra = (
frame_system::CheckSpecVersion<Runtime>,
frame_system::CheckTxVersion<Runtime>,
Expand Down
4 changes: 2 additions & 2 deletions bridges/bin/rialto/runtime/src/exchange.rs
Expand Up @@ -55,8 +55,8 @@ pub struct EthereumTransactionInclusionProof {
///
/// The assumption is that this pair will never appear more than once in
/// transactions included into finalized blocks. This is obviously true
/// for any existing eth-like chain (that keep current tx format), because
/// otherwise transaction can be replayed over and over.
/// for any existing eth-like chain (that keep current transaction format),
/// because otherwise transaction can be replayed over and over.
#[derive(Encode, Decode, PartialEq, RuntimeDebug)]
pub struct EthereumTransactionTag {
/// Account that has locked funds.
Expand Down
4 changes: 2 additions & 2 deletions bridges/bin/rialto/runtime/src/kovan.rs
Expand Up @@ -34,8 +34,8 @@ frame_support::parameter_types! {
kovan_validators_configuration();
}

/// Max number of finalized headers to keep. It is equivalent of ~24 hours of
/// finalized blocks on current Kovan chain.
/// Max number of finalized headers to keep. It is equivalent of approximately
/// 24 hours of finalized blocks on current Kovan chain.
const FINALIZED_HEADERS_TO_KEEP: u64 = 20_000;

/// Aura engine configuration for Kovan chain.
Expand Down
10 changes: 5 additions & 5 deletions bridges/bin/rialto/runtime/src/lib.rs
Expand Up @@ -206,7 +206,7 @@ impl frame_system::Config for Runtime {
type BlockLength = bp_rialto::BlockLength;
/// The weight of database operations that the runtime can invoke.
type DbWeight = DbWeight;
/// The designated SS58 prefix of this chain.
/// The designated `SS58` prefix of this chain.
type SS58Prefix = SS58Prefix;
/// The set code logic, just the default since we're not a parachain.
type OnSetCode = ();
Expand Down Expand Up @@ -346,7 +346,7 @@ parameter_types! {
}

impl pallet_timestamp::Config for Runtime {
/// A timestamp: milliseconds since the unix epoch.
/// A timestamp: milliseconds since the Unix epoch.
type Moment = u64;
type OnTimestampSet = Aura;
type MinimumPeriod = MinimumPeriod;
Expand Down Expand Up @@ -531,9 +531,9 @@ pub type Header = generic::Header<BlockNumber, Hashing>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
/// A Block signed with a Justification
pub type SignedBlock = generic::SignedBlock<Block>;
/// BlockId type as expected by this runtime.
/// `BlockId` type as expected by this runtime.
pub type BlockId = generic::BlockId<Block>;
/// The SignedExtension to the basic transaction logic.
/// The `SignedExtension` to the basic transaction logic.
pub type SignedExtra = (
frame_system::CheckSpecVersion<Runtime>,
frame_system::CheckTxVersion<Runtime>,
Expand Down Expand Up @@ -1060,7 +1060,7 @@ impl_runtime_apis! {
/// Millau account ownership digest from Rialto.
///
/// The byte vector returned by this function should be signed with a Millau account private key.
/// This way, the owner of `rialto_account_id` on Rialto proves that the 'millau' account private key
/// This way, the owner of `rialto_account_id` on Rialto proves that the Millau account private key
/// is also under his control.
pub fn rialto_to_millau_account_ownership_digest<Call, AccountId, SpecVersion>(
millau_call: &Call,
Expand Down
2 changes: 1 addition & 1 deletion bridges/bin/rialto/runtime/src/rialto_poa.rs
Expand Up @@ -110,7 +110,7 @@ impl TPruningStrategy for PruningStrategy {
}
}

/// ChainTime provider
/// `ChainTime` provider
#[derive(Default)]
pub struct ChainTime;

Expand Down
4 changes: 2 additions & 2 deletions bridges/modules/currency-exchange/src/benchmarking.rs
Expand Up @@ -40,10 +40,10 @@ pub struct ProofParams<Recipient> {
/// When true, recipient must exists before import.
pub recipient_exists: bool,
/// When 0, transaction should have minimal possible size. When this value has non-zero value n,
/// transaction size should be (if possible) near to MIN_SIZE + n * SIZE_FACTOR.
/// transaction size should be (if possible) near to `MIN_SIZE + n * SIZE_FACTOR`.
pub transaction_size_factor: u32,
/// When 0, proof should have minimal possible size. When this value has non-zero value n,
/// proof size should be (if possible) near to MIN_SIZE + n * SIZE_FACTOR.
/// proof size should be (if possible) near to `MIN_SIZE + n * SIZE_FACTOR`.
pub proof_size_factor: u32,
}

Expand Down
10 changes: 5 additions & 5 deletions bridges/modules/dispatch/src/lib.rs
Expand Up @@ -19,7 +19,7 @@
//! The messages are interpreted directly as runtime `Call`. We attempt to decode
//! them and then dispatch as usual. To prevent compatibility issues, the Calls have
//! to include a `spec_version`. This will be checked before dispatch. In the case of
//! a succesful dispatch an event is emitted.
//! a successful dispatch an event is emitted.

#![cfg_attr(not(feature = "std"), no_std)]
#![warn(missing_docs)]
Expand Down Expand Up @@ -52,7 +52,7 @@ pub trait Config<I = DefaultInstance>: frame_system::Config {
/// The overarching event type.
type Event: From<Event<Self, I>> + Into<<Self as frame_system::Config>::Event>;
/// Id of the message. Whenever message is passed to the dispatch module, it emits
/// event with this id + dispatch result. Could be e.g. (LaneId, MessageNonce) if
/// event with this id + dispatch result. Could be e.g. (`LaneId`, `MessageNonce`) if
/// it comes from the messages module.
type MessageId: Parameter;
/// Type of account ID on source chain.
Expand All @@ -77,13 +77,13 @@ pub trait Config<I = DefaultInstance>: frame_system::Config {
/// The type that is used to wrap the `Self::Call` when it is moved over bridge.
///
/// The idea behind this is to avoid `Call` conversion/decoding until we'll be sure
/// that all other stuff (like `spec_version`) is ok. If we would try to decode
/// that all other stuff (like `spec_version`) is OK. If we would try to decode
/// `Call` which has been encoded using previous `spec_version`, then we might end
/// up with decoding error, instead of `MessageVersionSpecMismatch`.
type EncodedCall: Decode + Encode + Into<Result<<Self as Config<I>>::Call, ()>>;
/// A type which can be turned into an AccountId from a 256-bit hash.
/// A type which can be turned into an `AccountId` from a 256-bit hash.
///
/// Used when deriving target chain AccountIds from source chain AccountIds.
/// Used when deriving target chain `AccountId`s from source chain `AccountId`s.
type AccountIdConverter: sp_runtime::traits::Convert<sp_core::hash::H256, Self::AccountId>;
}

Expand Down
8 changes: 4 additions & 4 deletions bridges/primitives/header-chain/src/justification.rs
Expand Up @@ -16,7 +16,7 @@

//! Pallet for checking GRANDPA Finality Proofs.
//!
//! Adapted copy of substrate/client/finality-grandpa/src/justification.rs. If origin
//! Adapted copy of `substrate/client/finality-grandpa/src/justification.rs`. If origin
//! will ever be moved to the sp_finality_grandpa, we should reuse that implementation.

use codec::{Decode, Encode};
Expand Down Expand Up @@ -57,7 +57,7 @@ pub enum Error {
InvalidJustificationTarget,
/// The authority has provided an invalid signature.
InvalidAuthoritySignature,
/// The justification contains precommit for header that is not a descendant of the commit header.
/// The justification contains pre-commit for header that is not a descendant of the commit header.
PrecommitIsNotCommitDescendant,
/// The cumulative weight of all votes in the justification is not enough to justify commit
/// header finalization.
Expand Down Expand Up @@ -119,7 +119,7 @@ where
if signed.precommit.target_number < justification.commit.target_number {
return Err(Error::PrecommitIsNotCommitDescendant);
}
// all precommits must be for target block descendents
// all precommits must be for target block descendants
chain = chain.ensure_descendant(&justification.commit.target_hash, &signed.precommit.target_hash)?;
// since we know now that the precommit target is the descendant of the justification target,
// we may increase 'weight' of the justification target
Expand Down Expand Up @@ -154,7 +154,7 @@ where
}

// check that the cumulative weight of validators voted for the justification target (or one
// of its descendents) is larger than required threshold.
// of its descendants) is larger than required threshold.
let threshold = authorities_set.threshold().0.into();
if cumulative_weight >= threshold {
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion cli/src/cli.rs
Expand Up @@ -65,7 +65,7 @@ pub enum Subcommand {
#[cfg(not(feature = "try-runtime"))]
TryRuntime,

/// Key management cli utilities
/// Key management CLI utilities
Key(sc_cli::KeySubcommand),
}

Expand Down

0 comments on commit 8a6af44

Please sign in to comment.