feat(config): every lens off until the repository turns it on
Jorijn: "all lenses off by default and opt in only". Config::Defaults() gives every lens run: false; a config that turns on none - a missing `lenses` key included - has the one problem that names the lenses, so config, freeze and run all stop on it; the template ships every lens off, init says to turn lenses on, and the "no lens runs" preflight names the cause. A consumer config without a `lenses` key now needs one, as the CI smoke test's does. Proven with the lens commit before it: the suite (26 passed), and the dry-run comparison recorded there.
This commit is contained in:
parent
febbfc3fcc
commit
101471d81a
15 changed files with 513 additions and 269 deletions
|
|
@ -1720,7 +1720,9 @@ namespace Crafter::Review::Run {
|
|||
const std::vector<Plan::Gate> gates = Plan::GatesFor(only, without, off);
|
||||
if (gates.empty()) {
|
||||
std::vector<std::string> why;
|
||||
if (!off.empty()) {
|
||||
if (off.size() == Plan::Lenses.size()) {
|
||||
why.emplace_back("the config turns on no lens (every lens is off until lenses.<name>.run = true turns it on)");
|
||||
} else if (!off.empty()) {
|
||||
std::vector<std::string> names;
|
||||
for (const std::string& lf : off) names.push_back(Plan::LensName(lf));
|
||||
why.push_back(std::format("the config turns off {}", Dyn::Join(names, ", ")));
|
||||
|
|
|
|||
Loading…
Reference in a new issue