Skip to content

Commit 16486d5

Browse files
committed
fix: make stylua hook CI-compatible with Nix fallback
- Add conditional check for Nix availability in stylua hook - Skip stylua formatting gracefully when Nix is not available (CI environments) - Maintain local functionality while preventing CI failures - Use bash wrapper to handle conditional execution
1 parent d0cbe88 commit 16486d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ repos:
5555
- id: stylua
5656
name: stylua
5757
description: Format Lua code with StyLua
58-
entry: nix
59-
args: [shell, nixpkgs#stylua, -c, stylua]
58+
entry: bash
59+
args: [-c, 'if command -v nix >/dev/null 2>&1; then nix shell nixpkgs#stylua -c stylua "$@"; else echo "Skipping stylua (Nix not available)"; fi', --]
6060
language: system
6161
files: \.lua$

0 commit comments

Comments
 (0)