Skip to content

Commit 0ee43ae

Browse files
committed
bubble up the validation summary
1 parent 49dd024 commit 0ee43ae

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

ROADMAP.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ API
3636
- [ ] can utils/config be made into a single submodule? how does that play with the bundler?
3737
- [ ] do we want a way to dump the schema for documentation purposes?
3838

39-
config_validate
40-
- [ ] if a build has no includes, warn
41-
- [ ] do we want a message if strict mode is off but we issued warnings reminding them about strict mode?
42-
- [ ] Return the summary object to your CLI for machine-readable reporting (--json).?
43-
4439
config_resolve
4540
- [ ] resolve_build_config takes args to get log_level, doesn't touch runtime, why?
4641
- [ ] maybe abstract _normalize_path_with_root in config_resolve for _include, _exclude, and _out for if statement clarity

src/pocket_build/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def main(argv: list[str] | None = None) -> int: # noqa: C901, PLR0911, PLR0912,
273273
root_cfg: RootConfig | None = None
274274
config_result = load_and_validate_config(args)
275275
if config_result is not None:
276-
config_path, root_cfg = config_result
276+
config_path, root_cfg, _validation_summary = config_result
277277

278278
# NOTE: log-level now fully set from config file
279279
logger.trace(

src/pocket_build/config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,15 +407,15 @@ def _validation_summary(
407407

408408
def load_and_validate_config(
409409
args: argparse.Namespace,
410-
) -> tuple[Path, RootConfig] | None:
410+
) -> tuple[Path, RootConfig, ValidationSummary] | None:
411411
"""Find, load, parse, and validate the user's configuration.
412412
413413
Also determines the effective log level (from CLI/env/config/default)
414414
early, so logging can initialize as soon as possible.
415415
416416
Returns:
417-
(config_path, root_cfg) if a config file was found and valid,
418-
or None if no config was found.
417+
(config_path, root_cfg, validation_summary)
418+
if a config file was found and valid, or None if no config was found.
419419
420420
"""
421421
logger = get_logger()
@@ -469,4 +469,4 @@ def load_and_validate_config(
469469

470470
# --- Upgrade to RootConfig type ---
471471
root_cfg: RootConfig = cast_hint(RootConfig, parsed_cfg)
472-
return config_path, root_cfg
472+
return config_path, root_cfg, validation_result

0 commit comments

Comments
 (0)