(d5a8a3f) Add make check, one command for fmt, clippy and the suite, and bump to 0.32.20
AGENTS.md pins `cargo fmt --check` and `cargo clippy --all-targets` as clean, and 83d31cd is what happens when only memory enforces that: fmt drifted to about 160 places across every file with the tool installed and configured by default the whole time. The decision the ticket wanted, taken: mechanise it, as one command. Not CI, which a single-author tool with no pipeline anywhere does not want, and not a hook, which is a per-clone opt-in the way `blame.ignoreRevsFile` is and so cannot be relied on either. What was missing was never a mechanism, it was one name to type: "remember to run fmt, clippy and the tests" becomes `make check`. Cheapest first, so a formatting slip is reported in a second rather than after the suite. `-D warnings` is what turns clippy's opinion into an exit code, since a warning printed into a wall of cargo output is unread rather than clean. Verified each gate fails on its own: a misformatted function and a `&Vec<u8>` parameter each exit 2 before the tests run. Completions are inside `cargo test` rather than a target of their own. d93eca6 put the check that loads the generated script into a real fish there, so "check tests, check completions" is already one command, and a second target would be a second thing to remember, which is the problem this is solving. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
b63b60eefc
commit
cd7c99fe39
@@ -53,7 +53,8 @@ repo. Do not restate any of it in this file: a second copy is a copy that goes s
|
||||
and this file is for what someone changing worklane's own code needs.
|
||||
|
||||
## Testing
|
||||
- Run: `cargo test`
|
||||
- **Run `make check` before committing**: `cargo fmt --check`, then `cargo clippy --all-targets -- -D warnings`, then `cargo test`, cheapest first. That is the whole of the enforcement, and it is deliberate rather than a stopgap: this repo has no CI and does not want any, and a git hook is a per-clone opt-in the way `blame.ignoreRevsFile` is, so neither can be relied on. What was missing was one name to type, so the two rules below are a command and not a memory. `-D warnings` is what makes clippy's opinion an exit code; a warning printed into a wall of cargo output is unread, not clean. The completion checks are inside `cargo test` rather than a target of their own, since a second thing to remember is the problem this solves
|
||||
- Run one suite: `cargo test`
|
||||
- Tests use `assert_cmd` and `assert_fs` for CLI testing
|
||||
- `setup_worklane()` creates temp `.worklane/` with the four flow status folders pre-created, plus `campaigns/` in `cmd_campaign.rs`, which is also where the on-demand creation is tested from a board without it. **The fixtures deliberately do not create `discarded/`**, so every discard test runs against a board that predates the status and `mv_creates_the_discarded_directory_on_a_board_that_predates_it` is not the only thing exercising the on-demand creation
|
||||
- `create_ticket()` writes fully-formed markdown files directly (no `--` separator for positional args in test commands)
|
||||
@@ -62,8 +63,8 @@ and this file is for what someone changing worklane's own code needs.
|
||||
- **`WORKLANE_KEEP_FIXTURES=1 cargo test` keeps the fixtures and prints each path.** Opt-in rather than kept-automatically-on-failure, because the assertions here carry the state they are about: a failing board test prints the rendered rows. The flag is read once when a fixture is made rather than at drop time, so the answer cannot change mid-test, and `Fixture::swept()` turns it off for the three tests that are about the guard itself and must not be failed by a reader's environment
|
||||
- **Verify a claim about leaked fixtures against a clean temp dir, not against `/tmp`.** `TMPDIR=/tmp/scratch cargo test` then count what is left in it: `/tmp` still holds the historical leak, so counting there measures the past rather than the change
|
||||
- In `tui.rs`, `write_member_card` is `write_tagged_card` plus a Campaign field and `write_campaign` puts a campaign on disk, creating the campaigns directory as it goes — `board_dir()` deliberately does not, so every test that does not write one is also the test that a board with no campaigns draws. `picker_rows` cuts the picker's list out of the frame by its own geometry, for the reason `overlay_title_row` exists: a card carries the same campaign label, so a search over every row finds the board rather than the list
|
||||
- **`cargo clippy --all-targets` is clean. Keep it clean**, and do not silence a lint that is pointing at something real. The only two `allow`s in the tree sit on the `create_ticket` fixtures in `cmd_mv.rs` and `cmd_show.rs`, each carrying the reason and what would replace it
|
||||
- **`cargo fmt --check` is clean too, and `rustfmt.toml` is what makes that affordable.** rustfmt is the formatter here, run it. The config is four stable width settings and nothing else:
|
||||
- **`cargo clippy --all-targets` is clean, and `make check` is what says so. Keep it clean**, and do not silence a lint that is pointing at something real. The only two `allow`s in the tree sit on the `create_ticket` fixtures in `cmd_mv.rs` and `cmd_show.rs`, each carrying the reason and what would replace it
|
||||
- **`cargo fmt --check` is clean too, `make check` runs it first, and `rustfmt.toml` is what makes that affordable.** rustfmt is the formatter here, run it. The config is four stable width settings and nothing else:
|
||||
|
||||
| setting | value | why |
|
||||
|---|---|---|
|
||||
|
||||
Generated
+1
-1
@@ -1503,7 +1503,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "worklane"
|
||||
version = "0.32.19"
|
||||
version = "0.32.20"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"assert_cmd",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "worklane"
|
||||
version = "0.32.19"
|
||||
version = "0.32.20"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -5,15 +5,37 @@
|
||||
# release cannot end up half-done: no version bump left untagged, no tag without
|
||||
# a bump.
|
||||
|
||||
.PHONY: help patch minor major version release install
|
||||
.PHONY: help check patch minor major version release install
|
||||
|
||||
help:
|
||||
@echo "make check fmt, clippy and the suite, in that order"
|
||||
@echo "make patch bump $(CURRENT) -> next patch, amend into HEAD, tag"
|
||||
@echo "make minor bump $(CURRENT) -> next minor, amend into HEAD, tag"
|
||||
@echo "make major bump $(CURRENT) -> next major, amend into HEAD, tag"
|
||||
@echo "make version print the current version"
|
||||
@echo "make install cargo install --path . && worklane install-skill"
|
||||
|
||||
# The one command to run before committing. AGENTS.md pins fmt and clippy as clean and
|
||||
# 83d31cd is what happens when only memory enforces that: fmt drifted to about 160 places
|
||||
# across every file with the tool installed and configured the whole time. This is not CI,
|
||||
# which a single-author tool with no pipeline anywhere does not want, and not a hook, which
|
||||
# is a per-clone opt-in the way `blame.ignoreRevsFile` is. It is one name to type, so
|
||||
# "remember to run fmt, clippy and the tests" becomes "run make check".
|
||||
#
|
||||
# Cheapest first, so a formatting slip is reported in a second rather than after the suite.
|
||||
# `--all-targets` on clippy, matching the rule in AGENTS.md, so the tests are linted too.
|
||||
# `-D warnings` is what makes clippy's opinion an exit code: the rule says clean, and a
|
||||
# warning printed into a wall of cargo output is not clean, it is unread.
|
||||
#
|
||||
# Completions are in the suite rather than a step of their own. `cargo test` sources the
|
||||
# generated script into a real fish and asks it for candidates, so "check tests, check
|
||||
# completions" is one command already, and a second target would be a second thing to
|
||||
# remember. The fish tests skip when fish is not installed, printing that they did.
|
||||
check:
|
||||
cargo fmt --check
|
||||
cargo clippy --all-targets -- -D warnings
|
||||
cargo test
|
||||
|
||||
# Read from the [package] table of Cargo.toml, which is the version the binary
|
||||
# reports through `--version`, so it is the single source of truth. The name is
|
||||
# what finds this crate's own entry in Cargo.lock.
|
||||
|
||||
@@ -88,6 +88,17 @@ the command. A pipe holds 64 KiB, so a listing that fits lands in the buffer who
|
||||
and the writer never learns the reader left, giving 0. Only output past that gets far
|
||||
enough to be cut off. Either way nothing is printed to stderr.
|
||||
|
||||
## Checking
|
||||
|
||||
```sh
|
||||
make check # cargo fmt --check, clippy -D warnings, cargo test
|
||||
```
|
||||
|
||||
One command, cheapest first, and the whole of what enforces the formatting and lint rules:
|
||||
there is no CI here and no hook. The completion tests inside it source the generated script
|
||||
into a real fish and ask it what it would offer, so they skip, saying so, on a machine
|
||||
without fish.
|
||||
|
||||
## Releasing
|
||||
|
||||
```sh
|
||||
|
||||
Reference in New Issue
Block a user