Repository: kedro-org/kedro
File: kedro/framework/cli/starters.py (Python)

Code before:
    return value.strip().lower() in ["y", "yes"] if value is not None else None


def _validate_selected_tools(selected_tools):
    valid_tools = list(TOOLS_SHORTNAME_TO_NUMBER) + ["all", "none"]

    if selected_tools is not None:
        tools = re.sub(r"\s", "", selected_tools).split(",")
        for tool in tools:
            if tool not in valid_tools:
                click.secho(
                    "Please select from the available tools: lint, test, log, docs, data, pyspark, viz, all, none",
                    fg="red",
                    err=True,
                )
                sys.exit(1)
        if ("none" in tools or "all" in tools) and len(tools) > 1:
            click.secho(
                "Tools options 'all' and 'none' cannot be used with other options",
                fg="red",
                err=True,
            )
            sys.exit(1)


def _print_tools_selection(selected_tools):
    if selected_tools is not None:
        if selected_tools == "['None']":
            click.secho(
                "You have selected no project tools",
                fg="green",
            )
        else:
            click.secho(
                f"You have selected the following project tools: {selected_tools}",
                fg="green",
            )


def _print_example_selection(example_pipeline):
    if example_pipeline is not None:
        if example_pipeline:
            click.secho(
                "It has been created with an example pipeline.",
                fg="green",
            )


# noqa: missing-function-docstring
@click.group(context_settings=CONTEXT_SETTINGS, name="Kedro")
def create_cli():  # pragma: no cover

Review comment (suggestion):
I've been working on getting `mypy --strict` to run without errors and it would flag this as not having a type for the argument and the return type. Can you add that? (See https://github.com/kedro-org/kedro/pull/3490/files for all changes already pending for `starters.py`)

Code after:
                (\ *,\ *\d+(\ *-\ *\d+)?)*       # D: any number of instances of: a comma followed by B and C, spaces allowed
                \ *)?)                           # E: zero or one instances of (B,C,D) as empty strings are also permissible
                $""",
            "error_message": f"'{text}' is an invalid value for project tools. Please select valid options for tools using comma-separated values, ranges, or 'all/none'.",
        },
    }

    if not re.match(VALIDATION_PATTERNS[pattern_name]["regex"], text, flags=re.X):
        click.secho(
            VALIDATION_PATTERNS[pattern_name]["error_message"],
            fg="red",
            err=True,
        )
        sys.exit(1)


def _parse_yes_no_to_bool(value):
    return value.strip().lower() in ["y", "yes"] if value is not None else None


def _validate_selected_tools(selected_tools):
    valid_tools = list(TOOLS_SHORTNAME_TO_NUMBER) + ["all", "none"]

    if selected_tools is not None:
        tools = re.sub(r"\s", "", selected_tools).split(",")
        for tool in tools:
            if tool not in valid_tools:
                click.secho(
                    "Please select from the available tools: lint, test, log, docs, data, pyspark, viz, all, none",
                    fg="red",
                    err=True,
                )
                sys.exit(1)
        if ("none" in tools or "all" in tools) and len(tools) > 1:
            click.secho(
                "Tools options 'all' and 'none' cannot be used with other options",
                fg="red",
                err=True,
            )
            sys.exit(1)


def _print_selection_and_prompt_info(
    selected_tools: str | None, example_pipeline: bool | None, interactive: bool
) -> None:
    # Confirm tools selection
    if selected_tools is not None:
        if selected_tools == "['None']":
            click.secho(
                "You have selected no project tools",
                fg="green",