Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Why ktlint doesn't fails when auto-correct is enabled #162

Closed
tonilopezmr opened this issue Feb 28, 2018 · 3 comments
Closed

Why ktlint doesn't fails when auto-correct is enabled #162

tonilopezmr opened this issue Feb 28, 2018 · 3 comments

Comments

@tonilopezmr
Copy link

tonilopezmr commented Feb 28, 2018

When I run ktlint -F it doesn't fail when there is something that ktlint can't resolve it, only show error on the screen but doesn't return 1.

shyiko added a commit that referenced this issue Feb 28, 2018
@shyiko
Copy link
Collaborator

shyiko commented Feb 28, 2018

Good catch! Fixed in 0.17.0 (Maven Central sync might take up to 25 minutes).

@shyiko shyiko closed this as completed Feb 28, 2018
@tonilopezmr
Copy link
Author

Thank you! too fast!

@HannahFerch
Copy link

Hi, I have the same issue that was reported before the fix. When I run ktlint -F the commit passes even though there are reported formatting issues which cannot be auto corrected. I would like the commit to be failed in that case.

In the docs for ktlint -F it says: "auto-correct style violations (if some errors cannot be fixed automatically they will be printed to stderr)". Which doesn't mention that failing the commit is intended.

Is it possible to have the commit fail if there are issues which cannot be auto corrected?

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants