From 7fbfe18a2272b1cbc4d9c15e27eefa2bcba2789a Mon Sep 17 00:00:00 2001 From: Aliaksandr Tsurko Date: Mon, 25 Nov 2024 16:18:44 +0100 Subject: [PATCH] Reformat --- Cargo.toml | 14 -------------- node/build.rs | 2 +- pallets/subtensor/src/rpc_info/delegate_info.rs | 2 +- support/code-coverage/src/main.rs | 2 +- support/linting/src/lib.rs | 7 ++----- support/linting/src/lint.rs | 8 ++++---- 6 files changed, 9 insertions(+), 26 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a37b8c19b..4d0c80860 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -87,9 +87,6 @@ quote = "1" proc-macro2 = { version = "1", features = ["span-locations"] } walkdir = "2" -<<<<<<< HEAD -subtensor-macros = { path = "support/macros" } - frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } frame-executive = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } @@ -99,17 +96,6 @@ frame-system = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = " frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } -======= -frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.16.0-rc1", default-features = false } -frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.16.0-rc1" } -frame-executive = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.16.0-rc1", default-features = false } -frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.16.0-rc1", default-features = false } -frame-support = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.16.0-rc1", default-features = false } -frame-system = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.16.0-rc1", default-features = false } -frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.16.0-rc1", default-features = false } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.16.0-rc1", default-features = false } -frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.16.0-rc1", default-features = false } ->>>>>>> aa3cf981 (Restructure workspace) pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } diff --git a/node/build.rs b/node/build.rs index 893913053..aba66d859 100644 --- a/node/build.rs +++ b/node/build.rs @@ -5,5 +5,5 @@ fn main() { rerun_if_git_head_changed(); println!("cargo:rerun-if-changed=src"); - subtensor_linting::walk_src(); + subtensor_linting::walk_src(); } diff --git a/pallets/subtensor/src/rpc_info/delegate_info.rs b/pallets/subtensor/src/rpc_info/delegate_info.rs index a41b6e17e..5d73c24d7 100644 --- a/pallets/subtensor/src/rpc_info/delegate_info.rs +++ b/pallets/subtensor/src/rpc_info/delegate_info.rs @@ -7,7 +7,7 @@ extern crate alloc; use codec::Compact; use sp_core::hexdisplay::AsBytesRef; -#[freeze_struct("5752e4c650a83e0d")] +// #[freeze_struct("5752e4c650a83e0d")] #[derive(Decode, Encode, PartialEq, Eq, Clone, Debug)] pub struct DelegateInfo { delegate_ss58: T::AccountId, diff --git a/support/code-coverage/src/main.rs b/support/code-coverage/src/main.rs index 01c5a47f2..e9757636a 100644 --- a/support/code-coverage/src/main.rs +++ b/support/code-coverage/src/main.rs @@ -2,7 +2,7 @@ use std::env; use std::path::PathBuf; fn main() { - // should we instead provide an argument to set the directory? + // should we instead provide an argument to set the directory? let source_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); let mut source_dir = PathBuf::from(&source_dir); source_dir.pop(); diff --git a/support/linting/src/lib.rs b/support/linting/src/lib.rs index 62242f9b4..2621d5cc1 100644 --- a/support/linting/src/lib.rs +++ b/support/linting/src/lib.rs @@ -1,17 +1,14 @@ pub mod lint; pub use lint::*; +mod disallow_v1_benchmarks; mod forbid_as_primitive; mod forbid_keys_remove; mod pallet_index; mod require_freeze_struct; +pub use disallow_v1_benchmarks::DisallowV1Benchmarks; pub use forbid_as_primitive::ForbidAsPrimitiveConversion; pub use forbid_keys_remove::ForbidKeysRemoveCall; -mod disallow_v1_benchmarks; -mod pallet_index; -mod require_freeze_struct; - -pub use disallow_v1_benchmarks::DisallowV1Benchmarks; pub use pallet_index::RequireExplicitPalletIndex; pub use require_freeze_struct::RequireFreezeStruct; diff --git a/support/linting/src/lint.rs b/support/linting/src/lint.rs index 88553c968..439f9388b 100644 --- a/support/linting/src/lint.rs +++ b/support/linting/src/lint.rs @@ -1,12 +1,12 @@ -use proc_macro2::TokenTree; -use syn::{Attribute, File, Meta, MetaList, Path}; use std::env; use std::path::{Path, PathBuf}; use std::sync::mpsc; use std::{fs, str::FromStr}; +use proc_macro2::TokenTree; +use syn::{Attribute, File, Meta, MetaList, Path as SynPath}; + use rayon::prelude::*; -use syn::File; use walkdir::WalkDir; use crate::{ @@ -31,7 +31,7 @@ pub fn is_allowed(attibutes: &[Attribute]) -> bool { let Attribute { meta: Meta::List(MetaList { - path: Path { segments: attr, .. }, + path: SynPath { segments: attr, .. }, tokens: attr_args, .. }),