From 366d65bfe1c28936a182a011a8adf73626dfbbbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Wed, 22 Jul 2026 21:47:21 +0800 Subject: [PATCH] fix(pre-commit-hooks): Avoid Rust macros being treated as shebangs --- .pre-commit-config.yaml | 4 +++- nix/general/pre-commit-hooks.nix | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b950ed3..7005a67 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,9 @@ repos: - id: destroyed-symlinks - id: check-merge-conflict - id: detect-private-key - - id: check-shebang-scripts-are-executable + - exclude_types: + - rust + id: check-shebang-scripts-are-executable - id: check-executables-have-shebangs repo: builtin - hooks: diff --git a/nix/general/pre-commit-hooks.nix b/nix/general/pre-commit-hooks.nix index c6e6f92..c9f750e 100644 --- a/nix/general/pre-commit-hooks.nix +++ b/nix/general/pre-commit-hooks.nix @@ -78,7 +78,13 @@ importingFlake: { # # { id = "no-commit-to-branch"; } - { id = "check-shebang-scripts-are-executable"; } + { + id = "check-shebang-scripts-are-executable"; + exclude_types = [ + # Rust macros can look like shebangs + "rust" + ]; + } { id = "check-executables-have-shebangs"; } ]; }