phase 5
This commit is contained in:
@@ -20,23 +20,12 @@ cat > "$HOOKS_DIR/pre-commit" << 'EOF'
|
||||
echo "🔍 Running pre-commit linting..."
|
||||
echo ""
|
||||
|
||||
# Try to use nix run if available, otherwise use script directly
|
||||
if command -v nix &> /dev/null && [ -f "flake.nix" ]; then
|
||||
# Use nix run for consistent environment
|
||||
if ! nix run .#lint; then
|
||||
echo ""
|
||||
echo "❌ Linting failed. Fix errors or use --no-verify to skip."
|
||||
echo " Auto-fix: nix run .#lint-fix"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# Fallback to script
|
||||
if ! ./scripts/lint.sh; then
|
||||
echo ""
|
||||
echo "❌ Linting failed. Fix errors or use --no-verify to skip."
|
||||
echo " Auto-fix: ./scripts/lint.sh --fix"
|
||||
exit 1
|
||||
fi
|
||||
# Use nix flake linting for consistency
|
||||
if ! nix run .#lint; then
|
||||
echo ""
|
||||
echo "❌ Linting failed. Fix errors or use --no-verify to skip."
|
||||
echo " Auto-fix: nix run .#lint-fix"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user