Skip to content

exit code is 0 on failed "ruff check --fix" #872

@minrk

Description

@minrk

ruff check --fix may create some fixes that get normalized out in the actually_mutated check.

If the only fixable errors get normalized out such that mutated is True but actually_mutated is False, the output code is forced to 0, assuming that the present mutations are the only reason for the nonzero exit code, which may not be true, resulting in incorrectly successful hooks.

The only workaround I've figured out is to run it twice, once with --fix and again without.

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