Rustelo/.githooks/pre-commit
Jesús Pérex 76d374ea18
Some checks failed
CI/CD Pipeline / Test Suite (push) Has been cancelled
CI/CD Pipeline / Security Audit (push) Has been cancelled
CI/CD Pipeline / Build Docker Image (push) Has been cancelled
CI/CD Pipeline / Deploy to Staging (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Performance Benchmarks (push) Has been cancelled
CI/CD Pipeline / Cleanup (push) Has been cancelled
chore: add hidden files
2025-07-07 23:09:32 +01:00

17 lines
387 B
Bash
Executable File

#!/bin/bash
# Pre-commit hook to run cargo +nightly fmt
echo "Running cargo +nightly fmt..."
# Run cargo +nightly fmt
cargo +nightly fmt
# Check if there are any changes after formatting
if ! git diff --quiet; then
echo "Code has been formatted. Please add the changes and commit again."
echo "Run: git add . && git commit"
exit 1
fi
echo "Code formatting check passed!"