Skip to content

poetry check: distinguish warnings from errors? #9971

@seub

Description

@seub

Issue Kind

Brand new capability

Description

poetry check exits with error code 1 even when there are only warnings and no hard errors.

This is standard UNIX behavior, but it makes it impossible to distinguish warnings from hard errors.

Example scenario

When upgrading Poetry to 2.0, my project.toml file caused poetry check to raise warnings, and exit with exit code 1:

Screenshot 2025-01-06 at 3 39 20 PM

I don't have a problem with that, but it seems inconvenient that there is no way to check for warnings vs hard errors.

Suggested solutions

Here are two ideas:

  1. Exit with error code 2 when there are only warnings and no hard errors
  2. Add a flag --soft-warnings causing poetry check to pass (exit code 0) when there are only warnings and no hard errors

Workarounds

Suboptimal workaroung:

poetry check || echo "Some errors or warnings were raised by 'poetry check'"

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureFeature requests/implementationsstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions