scan.go:54-56 does if workers < 1 { workers = 1 }, and main.go:71-72 registers the flag with no validation. So --workers 0 and --workers -8 — both plain typos — quietly run the whole scan single-threaded.
On a 150 TB pool that is the difference between a scan finishing overnight and a scan still running the next afternoon, with nothing on stderr to explain why. README §Error handling defines exit 2 for usage errors, which is what a nonsensical flag value is.
Definition of done
scan rejects --workers less than 1 with a one-line usage error on stderr and exit 2.
The clamp in scan.go:54-56 is removed, since the value is now validated upstream.
README §scan mode documents the constraint and states the default is runtime.NumCPU().
A CLI test asserts exit 2 and the message for --workers 0 and --workers -1.
make check green.
`scan.go:54-56` does `if workers < 1 { workers = 1 }`, and `main.go:71-72` registers the flag with no validation. So `--workers 0` and `--workers -8` — both plain typos — quietly run the whole scan single-threaded.
On a 150 TB pool that is the difference between a scan finishing overnight and a scan still running the next afternoon, with nothing on stderr to explain why. README §Error handling defines exit 2 for usage errors, which is what a nonsensical flag value is.
## Definition of done
1. `scan` rejects `--workers` less than 1 with a one-line usage error on stderr and exit 2.
2. The clamp in `scan.go:54-56` is removed, since the value is now validated upstream.
3. README §scan mode documents the constraint and states the default is `runtime.NumCPU()`.
4. A CLI test asserts exit 2 and the message for `--workers 0` and `--workers -1`.
5. `make check` green.
clawbot
added this to the 1.0.0 milestone 2026-08-09 03:44:20 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
scan.go:54-56doesif workers < 1 { workers = 1 }, andmain.go:71-72registers the flag with no validation. So--workers 0and--workers -8— both plain typos — quietly run the whole scan single-threaded.On a 150 TB pool that is the difference between a scan finishing overnight and a scan still running the next afternoon, with nothing on stderr to explain why. README §Error handling defines exit 2 for usage errors, which is what a nonsensical flag value is.
Definition of done
scanrejects--workersless than 1 with a one-line usage error on stderr and exit 2.scan.go:54-56is removed, since the value is now validated upstream.runtime.NumCPU().--workers 0and--workers -1.make checkgreen.