summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/check-format11
-rwxr-xr-xtools/reformat10
2 files changed, 21 insertions, 0 deletions
diff --git a/tools/check-format b/tools/check-format
new file mode 100755
index 0000000..3b68537
--- /dev/null
+++ b/tools/check-format
@@ -0,0 +1,11 @@
+#!/bin/bash -e
+
+## tools/check-format
+##
+## Verifies that the project's code conforms to the project's preferred style. Exits non-zero
+## if there are style differences.
+
+cd "$(dirname "$0")/.."
+
+npx prettier --check .
+cargo fmt --all --check
diff --git a/tools/reformat b/tools/reformat
new file mode 100755
index 0000000..4dfe7c3
--- /dev/null
+++ b/tools/reformat
@@ -0,0 +1,10 @@
+#!/bin/bash -e
+
+## tools/reformat
+##
+## Automatically reformats code in this project to match the project style.
+
+cd "$(dirname "$0")/.."
+
+npx prettier --write .
+cargo fmt --all