From 14196cffe9af053a6694891bf1a3822a0eb81cb2 Mon Sep 17 00:00:00 2001 From: pommicket Date: Thu, 24 Aug 2023 15:30:35 -0400 Subject: pre-commit hook --- README.md | 13 ++++++++++++- pre-commit | 4 ++++ pre-commit.sh | 4 ---- 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100755 pre-commit delete mode 100755 pre-commit.sh diff --git a/README.md b/README.md index 7657ff7..aaf458f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## fractiform +## pugl online shader thingamabob @@ -21,3 +21,14 @@ we use webgl2 (and consequently GLSL ES 3.00) because: - `.alt` - alternate text for searching. e.g. a widget with name "Foo" and alt "bar" will show up in searches for both "foo" and "bar". + +### development + +before making any commits, run + +```sh +npm install +cp -i pre-commit .git/hooks/ +``` + +this ensures that your changes are prettified & linted. diff --git a/pre-commit b/pre-commit new file mode 100755 index 0000000..8c9427a --- /dev/null +++ b/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +npx eslint pugl.js || exit 1 +npx prettier -w pugl.js || exit 1 +git add pugl.js diff --git a/pre-commit.sh b/pre-commit.sh deleted file mode 100755 index 8c9427a..0000000 --- a/pre-commit.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -npx eslint pugl.js || exit 1 -npx prettier -w pugl.js || exit 1 -git add pugl.js -- cgit v1.2.3