test(cli): format --check with a rule name writes nothing

`crafter-build format --check format` read the second `format` as the
verb again, which set the mode back to applying and recorded no glob, so
it ran every transform and rewrote the project's sources, and exited 0,
though `--check` writes nothing. FormatCheckGlob drives Run() on a
staged project whose one rule, named "format", would change its
main.cpp, and holds the run to exiting 1, the check with a file to
change, with main.cpp as it was. It fails before the verb enum of the
commit before this one and passes with it.
This commit is contained in:
Jorijn van der Graaf 2026-11-08 23:31:46 +01:00
commit 4b1585c709
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
4 changed files with 99 additions and 0 deletions

View file

@ -0,0 +1,9 @@
// SPDX-License-Identifier: LGPL-3.0-only
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
import std;
int main() {
std::println("format-check");
return 0;
}