Skip to content

misleading configurate parameter 'single_file' #390

@mikesongming

Description

@mikesongming

From the user's viewpoint, single_file=true should lead to single output changelog file; but according to code, single_file=true means variable output files. Should we change the code or deprecate the single_file parameter?

It seems that single_file=true leads to news files of patterned name, while single_file=false leads to unique news file with content being overwritten at each run.

bulid.py

single output 'news_file' only when single_file=false:

        if config["single_file"]:
            # When single_file is enabled, the news file name changes based on the version.
            news_file = news_file.format(
                name=project_name, version=project_version, project_date=project_date
            )

_write.py

when single_file=false, each run will overwrite old changlelog records:

    if single_file:
        if not os.path.exists(news_file):
            existing_content = u""
        else:
            with io.open(news_file, "r", encoding="utf8") as f:
                existing_content = f.read()
        existing_content = existing_content.split(start_string, 1)
    else:
        existing_content = [u""]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions