diff --git a/.github/workflows/pr_pre-commit.yaml b/.github/workflows/pr_pre-commit.yaml index ec55fe78..bdc3ddfd 100644 --- a/.github/workflows/pr_pre-commit.yaml +++ b/.github/workflows/pr_pre-commit.yaml @@ -6,7 +6,7 @@ on: env: CARGO_TERM_COLOR: always - RUST_TOOLCHAIN_VERSION: "1.82.0" + RUST_TOOLCHAIN_VERSION: "nightly-2025-01-15" HADOLINT_VERSION: "v2.12.0" PYTHON_VERSION: "3.12" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a36fdcb7..c5bd8ad1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,10 +17,6 @@ repos: - repo: https://github.com/doublify/pre-commit-rust rev: eeee35a89e69d5772bdee97db1a6a898467b686e # 1.0 hooks: - - id: fmt - # Pinning to a specific rustc version, so that we get consistent formatting - entry: RUSTUP_TOOLCHAIN=nightly-2025-01-15 cargo fmt - args: ["--all", "--", "--check"] - id: clippy args: ["--all-targets", "--", "-D", "warnings"] @@ -78,3 +74,10 @@ repos: entry: cargo test stages: [pre-commit, pre-merge-commit, manual] pass_filenames: false + + - id: cargo-rustfmt + name: cargo-rustfmt + language: system + entry: cargo +nightly-2025-01-15 fmt --all -- --check + stages: [pre-commit] + pass_filenames: false diff --git a/rust/crd/src/authentication.rs b/rust/crd/src/authentication.rs index cf271139..e96c66b1 100644 --- a/rust/crd/src/authentication.rs +++ b/rust/crd/src/authentication.rs @@ -1,9 +1,8 @@ use serde::{Deserialize, Serialize}; use snafu::{ResultExt, Snafu}; -use stackable_operator::commons::authentication::AuthenticationClassProvider; use stackable_operator::{ client::Client, - commons::authentication::AuthenticationClass, + commons::authentication::{AuthenticationClass, AuthenticationClassProvider}, schemars::{self, JsonSchema}, }; diff --git a/rust/crd/src/security.rs b/rust/crd/src/security.rs index cbd03ece..88752135 100644 --- a/rust/crd/src/security.rs +++ b/rust/crd/src/security.rs @@ -6,9 +6,7 @@ //! This is required due to overlaps between TLS encryption and e.g. mTLS authentication or Kerberos use std::collections::BTreeMap; -use crate::{authentication, authentication::ResolvedAuthenticationClasses, tls, ZookeeperCluster}; use snafu::{ResultExt, Snafu}; -use stackable_operator::time::Duration; use stackable_operator::{ builder::{ self, @@ -24,8 +22,11 @@ use stackable_operator::{ client::Client, commons::authentication::AuthenticationClassProvider, k8s_openapi::api::core::v1::Volume, + time::Duration, }; +use crate::{authentication, authentication::ResolvedAuthenticationClasses, tls, ZookeeperCluster}; + type Result = std::result::Result; #[derive(Snafu, Debug)] diff --git a/rust/operator-binary/src/znode_controller.rs b/rust/operator-binary/src/znode_controller.rs index 413d282e..eda1b8ea 100644 --- a/rust/operator-binary/src/znode_controller.rs +++ b/rust/operator-binary/src/znode_controller.rs @@ -413,8 +413,9 @@ pub fn error_policy( } mod znode_mgmt { - use snafu::{OptionExt, ResultExt, Snafu}; use std::{collections::VecDeque, net::SocketAddr}; + + use snafu::{OptionExt, ResultExt, Snafu}; use tokio::net::lookup_host; use tokio_zookeeper::{Acl, Permission, ZooKeeper};