git.delta.rocks / jrsonnet / refs/commits / ea44e4495023

difftreelog

ci add pre-commit hook

Yaroslav Bolyukin2024-06-18parent: #8d39c73.patch.diff
in: master

5 files changed

modified.envrcdiffbeforeafterboth
--- a/.envrc
+++ b/.envrc
@@ -1 +1,8 @@
+RED='\033[0;31m'
+RESET='\033[0m'
+
 use flake
+
+if ! diff .github/hooks/pre-commit .git/hooks/pre-commit >/dev/null; then
+echo -e "${RED}Hooks are updated, read .github/hooks/pre-commit, and then install it with cp .github/hooks/pre-commit .git/hooks/pre-commit${RESET}"
+fi
added.github/hooks/pre-commitdiffbeforeafterboth
--- /dev/null
+++ b/.github/hooks/pre-commit
@@ -0,0 +1 @@
+cargo xtask lint
modifiedflake.nixdiffbeforeafterboth
--- a/flake.nix
+++ b/flake.nix
@@ -116,7 +116,7 @@
           };
         };
         devShells.default = craneLib.devShell {
-          nativeBuildInputs = with pkgs; [
+          packages = with pkgs; [
             alejandra
             cargo-edit
             cargo-asm
@@ -126,6 +126,9 @@
             lld
             hyperfine
             graphviz
+          ] ++ lib.optionals (!stdenv.isDarwin) [
+            valgrind
+            kcachegrind
           ];
         };
       }
modifiedxtask/Cargo.tomldiffbeforeafterboth
--- a/xtask/Cargo.toml
+++ b/xtask/Cargo.toml
@@ -15,3 +15,4 @@
 quote.workspace = true
 ungrammar.workspace = true
 xshell.workspace = true
+clap = {workspace = true, features = ["derive"]}
modifiedxtask/src/main.rsdiffbeforeafterboth
before · xtask/src/main.rs
1use anyhow::Result;23mod sourcegen;45fn main() -> Result<()> {6	sourcegen::generate_ungrammar()7}