def validate_config()

in jetstream/cli.py [0:0]


def validate_config(path: Iterable[os.PathLike], config_repos, private_config_repos, is_private):
    """Validate config files."""
    dirty = False
    collection = ExperimentCollection.from_experimenter()

    for config_file in path:
        config_file = Path(config_file)
        if not config_file.is_file():
            continue
        if ".example" in config_file.suffixes:
            print(f"Skipping example config {config_file}")
            continue

        print(f"Evaluating {config_file}...")

        if config_file.name == "functions.toml":
            FunctionsSpec.from_dict(toml.load(config_file))
            print(f"{config_file} OK")
            continue
        entity = entity_from_path(config_file, is_private)
        call = partial(
            validate,
            config=entity,
            config_getter=ConfigLoader.with_configs_from(config_repos).with_configs_from(
                private_config_repos, is_private=True
            ),
        )
        if (
            isinstance(entity, Config)
            and not isinstance(entity, DefaultConfig)
            and not isinstance(entity, DefinitionConfig)
        ):
            if (experiments := collection.with_slug(entity.slug).experiments) == []:
                print(f"No experiment with slug {entity.slug} in Experimenter.")
                dirty = True
                continue
            call = partial(
                validate,
                config=entity,
                config_getter=ConfigLoader.with_configs_from(config_repos).with_configs_from(
                    private_config_repos, is_private=True
                ),
                experiment=experiments[0],
            )
        try:
            call()
        except DryRunFailedError as e:
            print("Error evaluating SQL:")
            for i, line in enumerate(e.sql.split("\n")):
                print(f"{i + 1: 4d} {line.rstrip()}")
            print("")
            print(str(e))
            dirty = True
        except ExplicitSkipException:
            print("Found an explicit skip directive; will ignore this experiment.")
    sys.exit(dirty)