diff --git a/.github/workflows/ci-pre-commit.yml b/.github/workflows/ci-pre-commit.yml index 862f4fa5f3..061c6350b4 100644 --- a/.github/workflows/ci-pre-commit.yml +++ b/.github/workflows/ci-pre-commit.yml @@ -19,39 +19,12 @@ jobs: fetch-depth: 0 - uses: actions-rs/toolchain@v1 with: - profile: minimal - toolchain: nightly-2023-03-01 - components: rustfmt, clippy - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2023-07-23 - components: rustfmt, clippy - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2024-03-26 - components: rustfmt, clippy - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2024-08-04 - components: rustfmt, clippy - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.66.1 - components: rustfmt, clippy - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.73.0 - components: rustfmt, clippy - - uses: actions-rs/toolchain@v1 - with: - profile: minimal + profile: default toolchain: 1.82.0 - components: rustfmt, clippy + - name: Install Rust versions + run: | + rustup install 1.66.1 + rustup install 1.73.0 - name: Install protoc uses: arduino/setup-protoc@v3 - uses: actions/checkout@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 29b8e9a3d6..2b45f1ac78 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,7 +39,7 @@ repos: - id: cargo-fmt-remote-executor name: Cargo format for remote executor language: "rust" - entry: cargo +nightly-2023-03-01 fmt --manifest-path ./governance/remote_executor/Cargo.toml --all -- --config-path rustfmt.toml + entry: cargo +1.66.1 fmt --manifest-path ./governance/remote_executor/Cargo.toml --all pass_filenames: false files: governance/remote_executor - id: cargo-clippy-remote-executor @@ -52,7 +52,7 @@ repos: - id: cargo-fmt-cosmwasm name: Cargo format for cosmwasm contract language: "rust" - entry: cargo +nightly-2023-03-01 fmt --manifest-path ./target_chains/cosmwasm/Cargo.toml --all -- --config-path rustfmt.toml + entry: cargo +1.82.0 fmt --manifest-path ./target_chains/cosmwasm/Cargo.toml --all pass_filenames: false files: target_chains/cosmwasm - id: cargo-clippy-cosmwasm @@ -65,7 +65,7 @@ repos: - id: cargo-fmt-hermes name: Cargo format for Hermes language: "rust" - entry: cargo +nightly-2024-03-26 fmt --manifest-path ./apps/hermes/server/Cargo.toml --all -- --config-path rustfmt.toml + entry: cargo +1.82.0 fmt --manifest-path ./apps/hermes/server/Cargo.toml --all pass_filenames: false files: apps/hermes - id: cargo-clippy-hermes @@ -78,7 +78,7 @@ repos: - id: cargo-fmt-fortuna name: Cargo format for Fortuna language: "rust" - entry: cargo +nightly-2023-07-23 fmt --manifest-path ./apps/fortuna/Cargo.toml --all -- --config-path rustfmt.toml + entry: cargo +1.82.0 fmt --manifest-path ./apps/fortuna/Cargo.toml --all pass_filenames: false files: apps/fortuna - id: cargo-clippy-fortuna @@ -91,7 +91,7 @@ repos: - id: cargo-fmt-message-buffer name: Cargo format for message buffer contract language: "rust" - entry: cargo +nightly-2023-03-01 fmt --manifest-path ./pythnet/message_buffer/Cargo.toml --all -- --config-path rustfmt.toml + entry: cargo +1.66.1 fmt --manifest-path ./pythnet/message_buffer/Cargo.toml --all pass_filenames: false files: pythnet/message_buffer - id: cargo-clippy-message-buffer @@ -104,7 +104,7 @@ repos: - id: cargo-fmt-pythnet-sdk name: Cargo format for pythnet SDK language: "rust" - entry: cargo +nightly-2024-08-04 fmt --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --all -- --config-path rustfmt.toml + entry: cargo +1.82.0 fmt --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --all pass_filenames: false files: pythnet/pythnet_sdk - id: cargo-clippy-pythnet-sdk @@ -117,7 +117,7 @@ repos: - id: cargo-fmt-pyth-solana-receiver name: Cargo format for solana target chain contract language: "rust" - entry: cargo +nightly-2023-03-01 fmt --manifest-path ./target_chains/solana/Cargo.toml --all -- --config-path rustfmt.toml + entry: cargo +1.73.0 fmt --manifest-path ./target_chains/solana/Cargo.toml --all pass_filenames: false files: target_chains/solana - id: cargo-clippy-pyth-solana-receiver diff --git a/rustfmt.toml b/rustfmt.toml deleted file mode 100644 index 793e0a9ffe..0000000000 --- a/rustfmt.toml +++ /dev/null @@ -1,19 +0,0 @@ -edition = "2021" - -# Merge all imports into a clean vertical list of module imports. -imports_granularity = "One" -group_imports = "One" -imports_layout = "Vertical" - -# Better grep-ability. -empty_item_single_line = false - -# Consistent pipe layout. -match_arm_leading_pipes = "Preserve" - -# Align Fields -enum_discrim_align_threshold = 80 -struct_field_align_threshold = 80 - -# Allow up to two blank lines for visual grouping. -blank_lines_upper_bound = 2