Skip to content

Config errors sometimes result in exit code 0 #19548

@wyattscarpenter

Description

@wyattscarpenter

Several tests in cmdline.pyproject.test result in configuration errors, yet assert == Return code: 0. This is probably bad; they should probably give a return code of 2, for use error. See, for more information, #6003 (because apparently it isn't documented yet). See also #16764, which may be related.

Originally noted by @sterliakov in #19494 (comment), who also had this to say:

I really think this should be fixed, 2 sounds reasonable and consistent with other tools, most Unix tools do that (grep --wtf and ls --not-an-option do exit with 2 on my system, for example, and bad config file is semantically close to bad flags). Note that mypy --wtf also exits with 2, so we have a precedent, and ruff exits with 2 if it finds an unknown key in its pyproject.toml section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions