summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorojacobson <ojacobson@noreply.codeberg.org>2025-06-11 18:27:15 +0200
committerojacobson <ojacobson@noreply.codeberg.org>2025-06-11 18:27:15 +0200
commita6ae7ee0170e2235ffc9c4eacddae2fb6878ad07 (patch)
treeb183dc5557b9e6c6d46385581f74d30001d06065 /tools
parent71919b461f25bed1bb4708b0494d603de373ae11 (diff)
parentc0f3495ea54d12b2bad9b937ea9334594d0aa248 (diff)
Consolidate project linting into tool scripts.
The new `tools/check-lint` script checks lints across _all_ lintable files - JS (through `eslint`), and Rust (through `clippy` and `cargo check`). It also checks `eslint` against the whole project, not just against what's in the `ui` subdir, which means it now catches lintable issues in various JS config files. This was originally part of [another proposal][pr-6]. I've broken it out to make the intent clearer, and to make the proposal easier to get a handle on in isolation from other, related changes. Thanks to @wlonk for their input on this! [pr-6]: https://codeberg.org/ojacobson/pilcrow/pulls/6 Merges prop/lint-checks into main.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/check-lint11
-rwxr-xr-xtools/delint11
2 files changed, 22 insertions, 0 deletions
diff --git a/tools/check-lint b/tools/check-lint
new file mode 100755
index 0000000..ab7fdd3
--- /dev/null
+++ b/tools/check-lint
@@ -0,0 +1,11 @@
+#!/bin/bash -e
+
+## tools/check-lint
+##
+## Detects lintable mistakes and stylistic problems.
+
+cd "$(dirname "$0")/.."
+
+npx eslint
+cargo check
+cargo clippy
diff --git a/tools/delint b/tools/delint
new file mode 100755
index 0000000..132841b
--- /dev/null
+++ b/tools/delint
@@ -0,0 +1,11 @@
+#!/bin/bash -e
+
+## tools/delint
+##
+## Automatically fixes lintable mistakes and stylistic problems, where possible.
+
+cd "$(dirname "$0")/.."
+
+npx eslint --fix
+cargo fix
+cargo clippy --fix