Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
hook: Make `cargo check` only execute pre-push
Merged lorenz opened 1 year ago

This hook takes relatively long on my machine, and my impatience has lead to me doing git commit --no-verify, which defeats the purpose of having these hooks.

Note that others (like alejandra, cargo fmt and shellcheck) are reasonably fast and will keep doing good.

2 files changed +31 -27 5553a147 59a10214
modified flake.lock
@@ -65,10 +65,32 @@
        "type": "github"
      }
    },
+
    "git-hooks": {
+
      "inputs": {
+
        "flake-compat": "flake-compat",
+
        "gitignore": "gitignore",
+
        "nixpkgs": [
+
          "nixpkgs"
+
        ]
+
      },
+
      "locked": {
+
        "lastModified": 1742649964,
+
        "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=",
+
        "owner": "cachix",
+
        "repo": "git-hooks.nix",
+
        "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82",
+
        "type": "github"
+
      },
+
      "original": {
+
        "owner": "cachix",
+
        "repo": "git-hooks.nix",
+
        "type": "github"
+
      }
+
    },
    "gitignore": {
      "inputs": {
        "nixpkgs": [
-
          "pre-commit-hooks",
+
          "git-hooks",
          "nixpkgs"
        ]
      },
@@ -118,39 +140,17 @@
        "type": "github"
      }
    },
-
    "pre-commit-hooks": {
-
      "inputs": {
-
        "flake-compat": "flake-compat",
-
        "gitignore": "gitignore",
-
        "nixpkgs": [
-
          "nixpkgs"
-
        ]
-
      },
-
      "locked": {
-
        "lastModified": 1742649964,
-
        "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=",
-
        "owner": "cachix",
-
        "repo": "git-hooks.nix",
-
        "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82",
-
        "type": "github"
-
      },
-
      "original": {
-
        "owner": "cachix",
-
        "repo": "git-hooks.nix",
-
        "type": "github"
-
      }
-
    },
    "root": {
      "inputs": {
        "advisory-db": "advisory-db",
        "crane": "crane",
        "flake-utils": "flake-utils",
+
        "git-hooks": "git-hooks",
        "nixpkgs": [
          "nixpkgs-stable"
        ],
        "nixpkgs-stable": "nixpkgs-stable",
        "nixpkgs-unstable": "nixpkgs-unstable",
-
        "pre-commit-hooks": "pre-commit-hooks",
        "rust-overlay": "rust-overlay"
      }
    },
modified flake.nix
@@ -8,7 +8,7 @@

    crane.url = "github:ipetkov/crane";

-
    pre-commit-hooks = {
+
    git-hooks = {
      url = "github:cachix/git-hooks.nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
@@ -108,15 +108,19 @@

      # Set of checks that are run: `nix flake check`
      checks = {
-
        pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
+
        pre-commit-check = inputs.git-hooks.lib.${system}.run {
          src = ./.;
          settings.rust.check.cargoDeps = pkgs.rustPlatform.importCargoLock {lockFile = ./Cargo.lock;};
          hooks = {
            alejandra.enable = true;
            rustfmt.enable = true;
-
            cargo-check.enable = true;
+
            cargo-check = {
+
              enable = true;
+
              stages = ["pre-push"];
+
            };
            clippy = {
              enable = true;
+
              stages = ["pre-push"];
              settings.denyWarnings = true;
              packageOverrides.cargo = rustToolchain;
              packageOverrides.clippy = rustToolchain;