Skip to content

Add --fail-on-warnings flag #1780

@CarrotManMatt

Description

@CarrotManMatt

prek will print a warning message to stderr if there is a problem with configuration file, like unexpected keys. This warning is output, but execution continues if the problem is not fatal and leaves unambiguous configuration.

It would be great for my use case to be able to exit with a non-zero exit code whenever one of these warnings is about to be produced, even if all hooks passed. Of course this should not be default behaviour, so I suggest the use of the flag --faiil-on-warnings (with the corresponding environment variables).

Initially I thought this could be rolled into one of the report levels suggested in #1777, but seeing that the intention is for the report status levels to not affect the exit code, I split it into a new idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideaJust an idea

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions