]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
poe: added poe commit command running all tests possible before commiting with git
authorVasek Sraier <git@vakabus.cz>
Tue, 23 Mar 2021 14:41:49 +0000 (15:41 +0100)
committerAleš Mrázek <ales.mrazek@nic.cz>
Fri, 8 Apr 2022 14:17:51 +0000 (16:17 +0200)
manager/pyproject.toml
manager/scripts/commit [new file with mode: 0755]

index 46890440d2ef6b4b76b4a31e795d5fe5cfc0fb1d..93ba25f579d84109174261694f37a14e53e153ae 100644 (file)
@@ -34,6 +34,7 @@ test = { cmd = "pytest --cov=knot_resolver_manager --show-capture=all tests/", h
 check = { cmd = "scripts/codecheck", help = "Run static code analysis" }
 format = { cmd = "poetry run black knot_resolver_manager/ tests/", help = "Run 'Black' code formater" }
 fixdeps = { shell = "poetry install; yarn install", help = "Install/update dependencies according to configuration files"}
+commit = { shell = "scripts/commit", help = "Invoke every single check before commiting" }
 clean = """
   rm -rf .coverage
          .mypy_cache
diff --git a/manager/scripts/commit b/manager/scripts/commit
new file mode 100755 (executable)
index 0000000..5d0d043
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# fail early
+set -e
+
+# ensure consistent behaviour
+src_dir="$(dirname "$(realpath "$0")")"
+source $src_dir/_env.sh
+
+
+# run code check
+poe check
+
+# run integration tests
+poe integration
+
+# invoke commit
+git commit $@
\ No newline at end of file