feat : ajout config vitest/make/pre-commit/commit-msg + un exemple de test vitest

This commit is contained in:
2026-02-23 11:29:16 +01:00
parent 65d9060e26
commit 82ecc9cfe2
8 changed files with 1301 additions and 1 deletions

36
pre-commit Normal file
View File

@@ -0,0 +1,36 @@
#!/bin/sh
set -e
echo "######### Pre-commit hook start #############"
if ! command -v npm >/dev/null 2>&1; then
if [ -f ".nvmrc" ]; then
NVM_VERSION="$(tr -d '\r\n' < .nvmrc)"
NVM_VERSION="${NVM_VERSION#v}"
NPM_BIN="$HOME/.nvm/versions/node/v$NVM_VERSION/bin"
if [ -x "$NPM_BIN/npm" ]; then
PATH="$NPM_BIN:$PATH"
export PATH
fi
fi
fi
if ! command -v npm >/dev/null 2>&1; then
if [ -s "$HOME/.nvm/nvm.sh" ]; then
# shellcheck disable=SC1090
. "$HOME/.nvm/nvm.sh"
nvm use >/dev/null 2>&1 || true
fi
fi
if ! command -v npm >/dev/null 2>&1; then
echo "npm introuvable dans le hook. Abandon du commit."
exit 1
fi
echo "--- make pre-commit start ---"
make pre-commit
echo "--- make pre-commit finished ---"
echo "All checks passed. Proceeding with commit."
exit 0