summaryrefslogtreecommitdiff
path: root/docs/linting.md
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 /docs/linting.md
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 'docs/linting.md')
-rw-r--r--docs/linting.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/linting.md b/docs/linting.md
new file mode 100644
index 0000000..6620a74
--- /dev/null
+++ b/docs/linting.md
@@ -0,0 +1,23 @@
+# Linting
+
+We use automated tools, rather than human effort, to spot possible bugs or dubious structural choices, where possible. This is handled by three tools:
+
+- Javascript is linted using [eslint].
+- Rust is linted using [cargo check] and [clippy].
+
+[eslint]: https://eslint.org/
+
+[cargo check]: https://doc.rust-lang.org/cargo/commands/cargo-check.html
+
+[clippy]: https://doc.rust-lang.org/cargo/commands/cargo-clippy.html
+
+## Tools
+
+- To check for detectable lints, run
+ `tools/check-lint`. This should be run whenever making changes, and is part of the optional
+ `git-hooks/pre-commit` hook script.
+
+- To fix lints that have automatic fixes, run
+ `tools/delint`.
+
+You can also run the individual lint tools directly. The tool scripts listed above contain the specific commands needed.