Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(securite): update talisman instructions #548

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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