Repository: ManimCommunity/manim
File: manim/cli/new/group.py (Python)

Code before:
            cli_config["pixel_width"] = str(value[1])
        else:
            cli_config[key] = str(value)

    with open(project_cfg_path, "w") as conf:
        config.write(conf)


@click.command(
    context_settings=CONTEXT_SETTINGS,
    no_args_is_help=False,
    epilog=EPILOG,
    help="Create new projects.",
)
@click.argument("project_name", type=Path, required=False)
@click.argument("template_name", required=False)
@click.option(
    "-d",
    "--default",
    "default_settings",
    is_flag=True,
    help="Default settings for project creation.",
    nargs=1,
)
def project(default_settings, **args):
    """Project subcommand creates a project inside of a 'new folder'. The name of the 'new folder' is passed as the first argument to the command.

    Parameters
    ----------
        default_settings : :class:`bool`
            Is True if -d or --default flag is passed.
        **args : :class:`dict`
            Dictionary of arguments passed to the 'project' command.
    """
    if args["project_name"]:
        project_name = args["project_name"]
    else:
        project_name = click.prompt("Project Name", type=Path)

    if args["template_name"]:
        template_name = args["template_name"]
    else:
        # in the future when implementing a full template system. Choices are going to be saved in some sort of config file for templates
        template_name = click.prompt(
            "Template",
            type=click.Choice(get_template_names(), False),
            default="Default",
        )

    if project_name.is_dir():
        console.print(

Review comment (refactor):
I'm not sure why `'new folder'` is in quotes here. It seems like this should be `'project_name'` instead since that Path variable would be the folder created?

Also this is too long. Shorten lines and see https://click.palletsprojects.com/en/7.x/documentation/#documenting-scripts

Code after:
        else:
            cli_config[key] = str(value)

    with open(project_cfg_path, "w") as conf:
        config.write(conf)


@click.command(
    context_settings=CONTEXT_SETTINGS,
    epilog=EPILOG,
)
@click.argument("project_name", type=Path, required=False)
@click.option(
    "-d",
    "--default",
    "default_settings",
    is_flag=True,
    help="Default settings for project creation.",
    nargs=1,
)
def project(default_settings, **args):
    """Creates a new project.

    PROJECT_NAME is the name of the folder in which the new project will be initialized.
    """
    if args["project_name"]:
        project_name = args["project_name"]
    else:
        project_name = click.prompt("Project Name", type=Path)

    # in the future when implementing a full template system. Choices are going to be saved in some sort of config file for templates
    template_name = click.prompt(
        "Template",
        type=click.Choice(get_template_names(), False),
        default="Default",
    )

    if project_name.is_dir():
        console.print(
            f"\nFolder [red]{project_name}[/red] exists. Please type another name\n"
        )
    else:
        project_name.mkdir()
        new_cfg = dict()
        new_cfg_path = Path.resolve(project_name / "manim.cfg")

        if not default_settings:
            for key, value in CFG_DEFAULTS.items():
                if key == "scene_names":
                    new_cfg[key] = template_name + "Template"
                elif key == "resolution":