Skip to content

ktlint --format should return error code if unable to autocorrect #2795

@ccjernigan

Description

@ccjernigan

I ran into a bug in ktlint earlier today, which has motivated this feature request. I ran ktlint --format locally, before submitting a pull request where the CI system runs ktlint. ktlint --format did not fail locally (and I didn't look closely at the logs to see the warning), but ktlint on CI did fail.

Expected Behavior

When running ktlint --format, any inability to autocorrect should be an error result code.

Current Behavior

ktlint will print a warning, rather than returning an error result code.

Additional information

  • Current version of ktlint: 1.3.1

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