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

Code before:
            else extra_context.get("example_pipeline", "no")
        )  # type: ignore
    )

    return extra_context


def _convert_tool_names_to_numbers(selected_tools: str | None) -> str | None:
    """Prepares tools selection from the CLI input to the correct format
    to be put in the project configuration, if it exists.
    Replaces tool strings with the corresponding prompt number.

    Args:
        selected_tools: a string containing the value for the --tools flag,
            or None in case the flag wasn't used, i.e. lint,docs.

    Returns:
        String with the numbers corresponding to the desired tools, or
        None in case the --tools flag was not used.
    """
    if selected_tools is None:
        return None
    if selected_tools.lower() == "none":
        return ""
    if selected_tools.lower() == "all":
        return ",".join(TOOLS_SHORTNAME_TO_NUMBER.values())

    tools = []
    for tool in selected_tools.lower().split(","):
        tool_short_name = tool.strip()
        if tool_short_name in TOOLS_SHORTNAME_TO_NUMBER:
            tools.append(TOOLS_SHORTNAME_TO_NUMBER[tool_short_name])
    return ",".join(tools)


def _select_prompts_to_display(
    prompts_required: dict,
    selected_tools: str,
    project_name: str,
    example_pipeline: str,
) -> dict:
    """Selects which prompts an user will receive when creating a new
    Kedro project, based on what information was already made available
    through CLI input.

    Args:
        prompts_required: a dictionary of all the prompts that will be shown to
            the user on project creation.
        selected_tools: a string containing the value for the --tools flag,
            or None in case the flag wasn't used.
        project_name: a string containing the value for the --name flag, or

Review comment (suggestion):
I think this should be:
```suggestion
        return ",".join(NUMBER_TO_TOOLS_NAME.keys())
```
because we're now allowing singular and plural versions of some tools, e.g. `test` and `tests`

Code after:
            example_pipeline
            if example_pipeline is not None
            else extra_context.get("example_pipeline", "no")
        )  # type: ignore
    )

    return extra_context


def _convert_tool_names_to_numbers(selected_tools: str | None) -> str | None:
    """Prepares tools selection from the CLI input to the correct format
    to be put in the project configuration, if it exists.
    Replaces tool strings with the corresponding prompt number.

    Args:
        selected_tools: a string containing the value for the --tools flag,
            or None in case the flag wasn't used, i.e. lint,docs.

    Returns:
        String with the numbers corresponding to the desired tools, or
        None in case the --tools flag was not used.
    """
    if selected_tools is None:
        return None
    if selected_tools.lower() == "none":
        return ""
    if selected_tools.lower() == "all":
        return ",".join(NUMBER_TO_TOOLS_NAME.keys())

    tools = []
    for tool in selected_tools.lower().split(","):
        tool_short_name = tool.strip()
        if tool_short_name in TOOLS_SHORTNAME_TO_NUMBER:
            tools.append(TOOLS_SHORTNAME_TO_NUMBER[tool_short_name])
    return ",".join(tools)


def _select_prompts_to_display(
    prompts_required: dict,
    selected_tools: str,
    project_name: str,
    example_pipeline: str,
) -> dict:
    """Selects which prompts an user will receive when creating a new
    Kedro project, based on what information was already made available
    through CLI input.

    Args:
        prompts_required: a dictionary of all the prompts that will be shown to
            the user on project creation.
        selected_tools: a string containing the value for the --tools flag,