Skip to content

Commit

Permalink
fix(securite): update talisman instructions (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
revolunet authored Feb 9, 2024
1 parent b3b5d5d commit b20cf4f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/standards/securite.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@ sur le hook `pre-commit` de git.
yarn add -D husky is-ci node-talisman

# installer husky seulement si hors environnement de CI
npm set-script postinstall "is-ci || husky install"
npm pkg set scripts.postinstall="is-ci || husky install"

# installation de husky grâce au script de postinstall
yarn

# exécuter node-talisman sur le hook de pre-commit
# on détecte ici si l'interaction via un terminal est possible afin de ne pas
# crash quand le pre-commit est lancé par une application comme VSCode
yarn husky add .husky/pre-commit "if sh -c ': >/dev/tty' >/dev/null 2>/dev/null; then exec </dev/tty; yarn node-talisman --githook pre-commit -i; else yarn node-talisman --githook pre-commit; fi"
mkdir .husky
echo "if sh -c ': >/dev/tty' >/dev/null 2>/dev/null; then exec </dev/tty; yarn node-talisman --githook pre-commit -i; else yarn node-talisman --githook pre-commit; fi" > .husky/pre-commit

# informe Talisman que le repo est en JS/TS
# permet d'éviter de scanner yarn.lock par exemple
Expand Down

0 comments on commit b20cf4f

Please sign in to comment.