Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce consistent and correct toml formatting #2518

Merged
merged 32 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f4f3e15
consistent toml formatting
liamaharon Nov 28, 2023
69368f4
add missed toml
liamaharon Nov 28, 2023
743a8aa
better ignore
liamaharon Nov 28, 2023
069e62a
fix comment
liamaharon Nov 28, 2023
65ef868
Make Zepter not format the features
ggwpez Nov 28, 2023
18de10c
indent with tab
liamaharon Nov 29, 2023
7b93ca7
Merge branch 'master' into liam-format-toml
liamaharon Nov 29, 2023
662f56e
format
liamaharon Nov 29, 2023
8374302
update contributing.md
liamaharon Nov 29, 2023
8c64eb9
remove trailing spaces
liamaharon Nov 29, 2023
71354ad
ignore zombienet .toml files
liamaharon Nov 29, 2023
305ef27
Merge branch 'master' into liam-format-toml
liamaharon Nov 29, 2023
3cb80ec
remove kusama asset hub
liamaharon Nov 29, 2023
9f4509a
remove polkadot asset hub
liamaharon Nov 29, 2023
1f00942
fix merge
liamaharon Nov 29, 2023
2e89d11
fixes
liamaharon Nov 29, 2023
e85810c
fixes
liamaharon Nov 29, 2023
42376dc
fixes
liamaharon Nov 29, 2023
cf310e3
Merge branch 'master' into liam-format-toml
liamaharon Nov 29, 2023
0af3d31
Update .gitlab/pipeline/check.yml
liamaharon Nov 29, 2023
0e740fd
Merge branch 'master' into liam-format-toml
liamaharon Nov 29, 2023
8d4fba7
Merge branch 'master' into liam-format-toml
liamaharon Nov 30, 2023
4bc30cc
taplo format
liamaharon Nov 30, 2023
febd964
move config to .config
liamaharon Nov 30, 2023
235cf4d
fix ci
liamaharon Nov 30, 2023
64dfe5b
fix array order
liamaharon Nov 30, 2023
c5b5521
merge
liamaharon Dec 1, 2023
0d01c02
format
liamaharon Dec 1, 2023
7d11310
special order role for deb config
liamaharon Dec 1, 2023
4e1b89e
fix config
liamaharon Dec 1, 2023
7cffceb
fix cargo flag order
liamaharon Dec 1, 2023
6d2861a
fix style guide and move taplo config to .config
liamaharon Dec 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
52 changes: 26 additions & 26 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build]
rustdocflags = [
"-Dwarnings",
"-Arustdoc::redundant_explicit_links", # stylistic
"-Arustdoc::redundant_explicit_links", # stylistic
"-Dwarnings",
]

# An auto defined `clippy` feature was introduced,
Expand All @@ -12,30 +12,30 @@ rustdocflags = [
# RUSTFLAGS= cargo clippy
[target.'cfg(feature = "cargo-clippy")']
rustflags = [
"-Aclippy::all",
"-Dclippy::correctness",
"-Aclippy::if-same-then-else",
"-Asuspicious_double_ref_op",
"-Dclippy::complexity",
"-Aclippy::zero-prefixed-literal", # 00_1000_000
"-Aclippy::type_complexity", # raison d'etre
"-Aclippy::nonminimal-bool", # maybe
"-Aclippy::borrowed-box", # Reasonable to fix this one
"-Aclippy::too-many-arguments", # (Turning this on would lead to)
"-Aclippy::unnecessary_cast", # Types may change
"-Aclippy::identity-op", # One case where we do 0 +
"-Aclippy::useless_conversion", # Types may change
"-Aclippy::unit_arg", # styalistic.
"-Aclippy::option-map-unit-fn", # styalistic
"-Aclippy::bind_instead_of_map", # styalistic
"-Aclippy::erasing_op", # E.g. 0 * DOLLARS
"-Aclippy::eq_op", # In tests we test equality.
"-Aclippy::while_immutable_condition", # false positives
"-Aclippy::needless_option_as_deref", # false positives
"-Aclippy::derivable_impls", # false positives
"-Aclippy::stable_sort_primitive", # prefer stable sort
"-Aclippy::extra-unused-type-parameters", # stylistic
"-Aclippy::default_constructed_unit_structs", # stylistic
"-Aclippy::all",
"-Aclippy::bind_instead_of_map", # styalistic
"-Aclippy::borrowed-box", # Reasonable to fix this one
"-Aclippy::default_constructed_unit_structs", # stylistic
"-Aclippy::derivable_impls", # false positives
"-Aclippy::eq_op", # In tests we test equality.
"-Aclippy::erasing_op", # E.g. 0 * DOLLARS
"-Aclippy::extra-unused-type-parameters", # stylistic
"-Aclippy::identity-op", # One case where we do 0 +
"-Aclippy::if-same-then-else",
"-Aclippy::needless_option_as_deref", # false positives
"-Aclippy::nonminimal-bool", # maybe
"-Aclippy::option-map-unit-fn", # styalistic
"-Aclippy::stable_sort_primitive", # prefer stable sort
"-Aclippy::too-many-arguments", # (Turning this on would lead to)
"-Aclippy::type_complexity", # raison d'etre
"-Aclippy::unit_arg", # styalistic.
"-Aclippy::unnecessary_cast", # Types may change
"-Aclippy::useless_conversion", # Types may change
"-Aclippy::while_immutable_condition", # false positives
"-Aclippy::zero-prefixed-literal", # 00_1000_000
"-Asuspicious_double_ref_op",
"-Dclippy::complexity",
"-Dclippy::correctness",
]

[env]
Expand Down
56 changes: 28 additions & 28 deletions .config/lychee.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,36 @@ accept = [
200,

# Rate limited - GitHub likes to throw this.
429
429,
]

exclude_path = [ "./target" ]
exclude_path = ["./target"]

exclude = [
# Place holders (no need to fix these):
"http://visitme/",
"https://visitme/",
# TODO <https://github.com/paritytech/polkadot-sdk/issues/134>
"https://docs.substrate.io/main-docs/build/custom-rpc/#public-rpcs",
"https://docs.substrate.io/rustdocs/latest/sp_api/macro.decl_runtime_apis.html",
"https://github.com/ipfs/js-ipfs-bitswap/blob/",
"https://github.com/paritytech/polkadot-sdk/substrate/frame/timestamp",
"https://github.com/paritytech/substrate/frame/fast-unstake",
"https://github.com/zkcrypto/bls12_381/blob/e224ad4ea1babfc582ccd751c2bf128611d10936/src/test-data/mod.rs",
"https://polkadot.network/the-path-of-a-parachain-block/",
"https://research.web3.foundation/en/latest/polkadot/BABE/Babe/#6-practical-results",
"https://research.web3.foundation/en/latest/polkadot/block-production/Babe.html",
"https://research.web3.foundation/en/latest/polkadot/block-production/Babe.html#-6.-practical-results",
"https://research.web3.foundation/en/latest/polkadot/networking/3-avail-valid.html#topology",
"https://research.web3.foundation/en/latest/polkadot/NPoS/3.%20Balancing.html",
"https://research.web3.foundation/en/latest/polkadot/overview/2-token-economics.html",
"https://research.web3.foundation/en/latest/polkadot/overview/2-token-economics.html#inflation-model",
"https://research.web3.foundation/en/latest/polkadot/slashing/npos.html",
"https://research.web3.foundation/en/latest/polkadot/Token%20Economics.html#inflation-model",
"https://rpc.polkadot.io/",
"https://w3f.github.io/parachain-implementers-guide/node/approval/approval-distribution.html",
"https://w3f.github.io/parachain-implementers-guide/node/index.html",
"https://w3f.github.io/parachain-implementers-guide/protocol-chain-selection.html",
"https://w3f.github.io/parachain-implementers-guide/runtime/session_info.html",
# Place holders (no need to fix these):
"http://visitme/",
"https://visitme/",

# TODO <https://github.com/paritytech/polkadot-sdk/issues/134>
"https://docs.substrate.io/main-docs/build/custom-rpc/#public-rpcs",
"https://docs.substrate.io/rustdocs/latest/sp_api/macro.decl_runtime_apis.html",
"https://github.com/ipfs/js-ipfs-bitswap/blob/",
"https://github.com/paritytech/polkadot-sdk/substrate/frame/timestamp",
"https://github.com/paritytech/substrate/frame/fast-unstake",
"https://github.com/zkcrypto/bls12_381/blob/e224ad4ea1babfc582ccd751c2bf128611d10936/src/test-data/mod.rs",
"https://polkadot.network/the-path-of-a-parachain-block/",
"https://research.web3.foundation/en/latest/polkadot/BABE/Babe/#6-practical-results",
"https://research.web3.foundation/en/latest/polkadot/NPoS/3.%20Balancing.html",
"https://research.web3.foundation/en/latest/polkadot/Token%20Economics.html#inflation-model",
"https://research.web3.foundation/en/latest/polkadot/block-production/Babe.html",
"https://research.web3.foundation/en/latest/polkadot/block-production/Babe.html#-6.-practical-results",
"https://research.web3.foundation/en/latest/polkadot/networking/3-avail-valid.html#topology",
"https://research.web3.foundation/en/latest/polkadot/overview/2-token-economics.html",
"https://research.web3.foundation/en/latest/polkadot/overview/2-token-economics.html#inflation-model",
"https://research.web3.foundation/en/latest/polkadot/slashing/npos.html",
"https://rpc.polkadot.io/",
"https://w3f.github.io/parachain-implementers-guide/node/approval/approval-distribution.html",
"https://w3f.github.io/parachain-implementers-guide/node/index.html",
"https://w3f.github.io/parachain-implementers-guide/protocol-chain-selection.html",
"https://w3f.github.io/parachain-implementers-guide/runtime/session_info.html",
]
5 changes: 1 addition & 4 deletions .config/zepter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,15 @@ workflows:
'--left-side-outside-workspace=ignore',
# Some features imply that they activate a specific dependency as non-optional. Otherwise the default behaviour with a `?` is used.
'--feature-enables-dep=try-runtime:frame-try-runtime,runtime-benchmarks:frame-benchmarking',
# Actually modify the files and not just report the issues:
# Auxillary flags:
'--offline',
'--locked',
'--show-path',
'--quiet',
]
# Format the features into canonical format:
- ['format', 'features', '--offline', '--locked', '--quiet']
# Same as `check`, but with the `--fix` flag.
default:
- [ $check.0, '--fix' ]
- [ $check.1, '--fix' ]

# Will be displayed when any workflow fails:
help:
Expand Down
10 changes: 10 additions & 0 deletions .gitlab/pipeline/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ check-rust-feature-propagation:
- cargo install --locked --version 0.13.3 -q -f zepter && zepter --version
- zepter run check

check-toml-format:
stage: check
extends:
- .kubernetes-env
- .common-refs
script:
- cargo install taplo-cli --locked --version 0.8.1
- taplo format --check
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- taplo format --check
- taplo format --check
- echo "Please run `taplo format` to fix any kind of formatting issues"

@mordamax can we please enhance bot fmt to also run taplo format, after this pr got merged?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rcny probably better then to include taplo-cli into ci unified? so it's version is controlled from image, vs duplicated here and in cmd bot?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea sounds good. I think you can also add Zepter to it, it seems stable enough for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

paritytech/scripts#613
Zepter is also added via this PR, so Zepter installation could be removed from the CI job.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bkchr added taplo to bot fmt

- echo "Please run `taplo format` to fix any toml formatting issues"

# More info can be found here: https://github.com/paritytech/polkadot/pull/5865
.check-runtime-migration:
stage: check
Expand Down
18 changes: 9 additions & 9 deletions .gitlab/spellcheck.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ use_builtin = true
[hunspell.quirks]
# He tagged it as 'TheGreatestOfAllTimes'
transform_regex = [
# `Type`'s
# `Type`'s
"^'([^\\s])'$",
# 5x
# 10.7%
# 5x
# 10.7%
"^[0-9_]+(?:\\.[0-9]*)?(x|%)$",
# Transforms'
# Transforms'
"^(.*)'$",
# backslashes
"^\\+$",
# backslashes
"^[0-9]*+k|MB|Mb|ms|Mbit|nd|th|rd$",
# single char `=` `>` `%` ..
"^\\+$",
# single char `=` `>` `%` ..
"^=|>|<|%$",
# 22_100
"^(?:[0-9]+_)+[0-9]+$"
# 22_100
"^(?:[0-9]+_)+[0-9]+$",
]
allow_concatenation = true
allow_dashes = true
16 changes: 16 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# all options https://taplo.tamasfe.dev/configuration/formatter-options.html

# ignore zombienet as they do some deliberate custom toml stuff
exclude = [
"cumulus/zombienet/**",
"polkadot/node/malus/integrationtests/**",
"polkadot/zombienet_tests/**",
"substrate/zombienet/**",
]

[formatting]
reorder_arrays = true
inline_table_expand = false
array_auto_expand = false
array_auto_collapse = false
indent_string = " " # tab
26 changes: 13 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ members = [
"bridges/primitives/chain-bridge-hub-rococo",
"bridges/primitives/chain-bridge-hub-westend",
"bridges/primitives/chain-kusama",
"bridges/primitives/chain-polkadot-bulletin",
"bridges/primitives/chain-polkadot",
"bridges/primitives/chain-polkadot-bulletin",
"bridges/primitives/chain-rococo",
"bridges/primitives/chain-westend",
"bridges/primitives/header-chain",
Expand Down Expand Up @@ -69,6 +69,7 @@ members = [
"cumulus/parachains/integration-tests/emulated/chains/relays/westend",
"cumulus/parachains/integration-tests/emulated/common",
"cumulus/parachains/integration-tests/emulated/networks/rococo-system",
"cumulus/parachains/integration-tests/emulated/networks/rococo-westend-system",
"cumulus/parachains/integration-tests/emulated/networks/westend-system",
"cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo",
"cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend",
Expand Down Expand Up @@ -121,8 +122,8 @@ members = [
"polkadot/node/core/parachains-inherent",
"polkadot/node/core/prospective-parachains",
"polkadot/node/core/provisioner",
"polkadot/node/core/pvf-checker",
"polkadot/node/core/pvf",
"polkadot/node/core/pvf-checker",
"polkadot/node/core/pvf/common",
"polkadot/node/core/pvf/execute-worker",
"polkadot/node/core/pvf/prepare-worker",
Expand All @@ -145,10 +146,10 @@ members = [
"polkadot/node/overseer",
"polkadot/node/primitives",
"polkadot/node/service",
"polkadot/node/subsystem",
"polkadot/node/subsystem-test-helpers",
"polkadot/node/subsystem-types",
"polkadot/node/subsystem-util",
"polkadot/node/subsystem",
"polkadot/node/test/client",
"polkadot/node/test/service",
"polkadot/node/tracking-allocator",
Expand Down Expand Up @@ -177,8 +178,8 @@ members = [
"polkadot/utils/generate-bags",
"polkadot/utils/remote-ext-tests/bags-list",
"polkadot/xcm",
"polkadot/xcm/pallet-xcm-benchmarks",
"polkadot/xcm/pallet-xcm",
"polkadot/xcm/pallet-xcm-benchmarks",
"polkadot/xcm/procedural",
"polkadot/xcm/xcm-builder",
"polkadot/xcm/xcm-executor",
Expand Down Expand Up @@ -231,8 +232,8 @@ members = [
"substrate/client/merkle-mountain-range",
"substrate/client/merkle-mountain-range/rpc",
"substrate/client/mixnet",
"substrate/client/network-gossip",
"substrate/client/network",
"substrate/client/network-gossip",
"substrate/client/network/bitswap",
"substrate/client/network/common",
"substrate/client/network/light",
Expand All @@ -242,10 +243,10 @@ members = [
"substrate/client/network/transactions",
"substrate/client/offchain",
"substrate/client/proposer-metrics",
"substrate/client/rpc",
"substrate/client/rpc-api",
"substrate/client/rpc-servers",
"substrate/client/rpc-spec-v2",
"substrate/client/rpc",
"substrate/client/service",
"substrate/client/service/test",
"substrate/client/state-db",
Expand Down Expand Up @@ -273,8 +274,8 @@ members = [
"substrate/frame/bags-list/fuzzer",
"substrate/frame/bags-list/remote-tests",
"substrate/frame/balances",
"substrate/frame/beefy-mmr",
"substrate/frame/beefy",
"substrate/frame/beefy-mmr",
"substrate/frame/benchmarking",
"substrate/frame/benchmarking/pov",
"substrate/frame/bounties",
Expand All @@ -284,9 +285,9 @@ members = [
"substrate/frame/contracts",
"substrate/frame/contracts/fixtures",
"substrate/frame/contracts/fixtures/contracts/common",
"substrate/frame/contracts/uapi",
"substrate/frame/contracts/mock-network",
"substrate/frame/contracts/proc-macro",
"substrate/frame/contracts/uapi",
"substrate/frame/conviction-voting",
"substrate/frame/core-fellowship",
"substrate/frame/democracy",
Expand Down Expand Up @@ -423,12 +424,12 @@ members = [
"substrate/primitives/offchain",
"substrate/primitives/panic-handler",
"substrate/primitives/rpc",
"substrate/primitives/runtime",
"substrate/primitives/runtime-interface",
"substrate/primitives/runtime-interface/proc-macro",
"substrate/primitives/runtime-interface/test-wasm-deprecated",
"substrate/primitives/runtime-interface/test-wasm",
"substrate/primitives/runtime-interface/test",
"substrate/primitives/runtime",
"substrate/primitives/runtime-interface/test-wasm",
"substrate/primitives/runtime-interface/test-wasm-deprecated",
"substrate/primitives/session",
"substrate/primitives/staking",
"substrate/primitives/state-machine",
Expand Down Expand Up @@ -467,9 +468,8 @@ members = [
"substrate/utils/frame/try-runtime/cli",
"substrate/utils/prometheus",
"substrate/utils/wasm-builder",
"cumulus/parachains/integration-tests/emulated/networks/rococo-westend-system",
]
default-members = [ "polkadot", "substrate/bin/node/cli" ]
default-members = ["polkadot", "substrate/bin/node/cli"]

[profile.release]
# Polkadot runtime requires unwinding.
Expand Down
4 changes: 2 additions & 2 deletions bridges/bin/runtime-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ bp-test-utils = { path = "../../primitives/test-utils" }
pallet-balances = { path = "../../../substrate/frame/balances" }

[features]
default = [ "std" ]
default = ["std"]
std = [
"bp-header-chain/std",
"bp-messages/std",
Expand Down Expand Up @@ -92,4 +92,4 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
]
integrity-test = [ "static_assertions" ]
integrity-test = ["static_assertions"]
2 changes: 1 addition & 1 deletion bridges/modules/grandpa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ sp-core = { path = "../../../substrate/primitives/core" }
sp-io = { path = "../../../substrate/primitives/io" }

[features]
default = [ "std" ]
default = ["std"]
std = [
"bp-header-chain/std",
"bp-runtime/std",
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/messages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pallet-balances = { path = "../../../substrate/frame/balances" }
sp-io = { path = "../../../substrate/primitives/io" }

[features]
default = [ "std" ]
default = ["std"]
std = [
"bp-messages/std",
"bp-runtime/std",
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/parachains/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ sp-core = { path = "../../../substrate/primitives/core" }
sp-io = { path = "../../../substrate/primitives/io" }

[features]
default = [ "std" ]
default = ["std"]
std = [
"bp-header-chain/std",
"bp-parachains/std",
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/relayers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ sp-io = { path = "../../../substrate/primitives/io" }
sp-runtime = { path = "../../../substrate/primitives/runtime" }

[features]
default = [ "std" ]
default = ["std"]
std = [
"bp-messages/std",
"bp-relayers/std",
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/xcm-bridge-hub-router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ sp-io = { path = "../../../substrate/primitives/io" }
sp-std = { path = "../../../substrate/primitives/std" }

[features]
default = [ "std" ]
default = ["std"]
std = [
"bp-xcm-bridge-hub-router/std",
"codec/std",
Expand Down
Loading