Skip to content

Commit

Permalink
Improve features dev-ex (paritytech#1831)
Browse files Browse the repository at this point in the history
Adds a config file that allows to run `zepter` without any arguments in
the workspace to address all issues.
A secondary workflow for the CI is provided as `zepter run check`. Both
the formatting and linting are now in one check for efficiancy.

The latest version also detects some more things that `featalign` was
already showing.

Error message [in the
CI](https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/3916205)
now looks like this:
```pre
...
crate 'test-parachains' (/Users/vados/Documents/work/polkadot-sdk/polkadot/parachain/test-parachains/Cargo.toml)
  feature 'std'
    must propagate to:
      parity-scale-codec
Found 55 issues (run with --fix to fix).
Error: Command 'lint propagate-feature' failed with exit code 1

Polkadot-SDK uses the Zepter CLI to detect abnormalities in the feature configuration.
It looks like one more more checks failed; please check the console output. You can try to automatically address them by running `zepter`.
Otherwise please ask directly in the Merge Request, GitHub Discussions or on Matrix Chat, thank you.

For more information, see:
  - paritytech#1831
  - https://github.com/ggwpez/zepter
```

TODO:
- [x] Check that CI fails correctly

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez authored Oct 24, 2023
1 parent f16c4a3 commit 3a53c77
Show file tree
Hide file tree
Showing 22 changed files with 27 additions and 3 deletions.
1 change: 1 addition & 0 deletions substrate/bin/node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ std = [
"pallet-utility/std",
"pallet-vesting/std",
"pallet-whitelist/std",
"primitive-types/std",
"scale-info/std",
"sp-api/std",
"sp-authority-discovery/std",
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/asset-conversion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ std = [
"frame-system/std",
"pallet-assets/std",
"pallet-balances/std",
"primitive-types/std",
"scale-info/std",
"sp-api/std",
"sp-arithmetic/std",
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/democracy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ std = [
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"log/std",
"pallet-balances/std",
"pallet-preimage/std",
"pallet-scheduler/std",
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/glutton/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ std = [
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"log/std",
"pallet-balances/std",
"scale-info/std",
"sp-core/std",
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/identity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ sp-core = { path = "../../primitives/core" }
default = [ "std" ]
std = [
"codec/std",
"enumflags2/std",
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/message-queue/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ std = [
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"log/std",
"scale-info/std",
"sp-arithmetic/std",
"sp-core/std",
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/multisig/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ std = [
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"log/std",
"pallet-balances/std",
"scale-info/std",
"sp-io/std",
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/nfts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ sp-keystore = { path = "../../primitives/keystore" }
default = [ "std" ]
std = [
"codec/std",
"enumflags2/std",
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
Expand Down
2 changes: 2 additions & 0 deletions substrate/frame/nomination-pools/benchmarking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ sp-io = { path = "../../../primitives/io" }
default = [ "std" ]

std = [
"codec/std",
"frame-benchmarking/std",
"frame-election-provider-support/std",
"frame-support/std",
Expand All @@ -52,6 +53,7 @@ std = [
"pallet-nomination-pools/std",
"pallet-staking/std",
"pallet-timestamp/std",
"scale-info/std",
"sp-core/std",
"sp-io/std",
"sp-runtime-interface/std",
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/referenda/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ std = [
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"log/std",
"pallet-balances/std",
"pallet-preimage/std",
"pallet-scheduler/std",
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/society/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ std = [
"frame-support-test/std",
"frame-support/std",
"frame-system/std",
"log/std",
"pallet-balances/std",
"rand_chacha/std",
"scale-info/std",
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/statement/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ std = [
"codec/std",
"frame-support/std",
"frame-system/std",
"log/std",
"pallet-balances/std",
"scale-info/std",
"sp-api/std",
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ std = [
"log/std",
"scale-info/std",
"serde/std",
"serde_json/std",
"sp-api/std",
"sp-arithmetic/std",
"sp-core/std",
Expand Down
2 changes: 1 addition & 1 deletion substrate/primitives/api/proc-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ assert_matches = "1.3.0"
[features]
# Required for the doc tests
default = [ "std" ]
std = []
std = [ "blake2/std" ]
no-metadata-docs = []
frame-metadata = []
1 change: 1 addition & 0 deletions substrate/primitives/consensus/beefy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ std = [
"sp-mmr-primitives/std",
"sp-runtime/std",
"sp-std/std",
"strum/std",
]

# Serde support without relying on std features.
Expand Down
2 changes: 2 additions & 0 deletions substrate/primitives/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ std = [
"thiserror",
"tiny-bip39",
"tracing",
"w3f-bls?/std",
"zeroize/alloc",
"zeroize/std",
]

# Serde support without relying on std features.
Expand Down
3 changes: 2 additions & 1 deletion substrate/primitives/io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ std = [
"bytes/std",
"codec/std",
"ed25519-dalek",
"ed25519-dalek?/std",
"libsecp256k1",
"log",
"log/std",
"secp256k1",
"sp-core/std",
"sp-externalities/std",
Expand Down
1 change: 1 addition & 0 deletions substrate/primitives/merkle-mountain-range/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ std = [
"codec/std",
"log/std",
"mmr-lib/std",
"scale-info/std",
"serde/std",
"sp-api/std",
"sp-core/std",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ substrate-wasm-builder = { path = "../../../utils/wasm-builder", optional = true
[features]
default = [ "std" ]
std = [
"bytes/std",
"sp-core/std",
"sp-io/std",
"sp-runtime-interface/std",
Expand Down
2 changes: 2 additions & 0 deletions substrate/primitives/statement-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ rand = { version = "0.8.5", features = ["small_rng"], optional = true }
default = [ "std" ]
std = [
"aes-gcm",
"aes-gcm?/std",
"codec/std",
"curve25519-dalek",
"ed25519-dalek",
"hkdf",
"hkdf?/std",
"rand",
"scale-info/std",
"sha2",
Expand Down
2 changes: 1 addition & 1 deletion substrate/primitives/wasm-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ sp-std = { path = "../std", default-features = false}

[features]
default = [ "std" ]
std = [ "codec/std", "log", "sp-std/std", "wasmtime" ]
std = [ "codec/std", "log/std", "sp-std/std", "wasmtime" ]
wasmtime = [ "anyhow", "dep:wasmtime" ]
2 changes: 2 additions & 0 deletions substrate/test-utils/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ std = [
"sc-executor/std",
"sc-service",
"scale-info/std",
"serde/std",
"serde_json/std",
"sp-api/std",
"sp-application-crypto/std",
"sp-block-builder/std",
Expand Down

0 comments on commit 3a53c77

Please sign in to comment.