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

Call callback on all errors #1499

Merged

Conversation

paul-dingemans
Copy link
Collaborator

Description

The callback function provided as parameter to the format function is now called for all errors regardless whether the error has been autocorrected. Existing consumers of the format function should now explicitly check the autocorrected flag in the callback result and handle it appropriately (in most case this will be ignoring the callback results for which autocorrected has value true).

Closes #1491

Checklist

  • PR description added
  • tests are added
  • CHANGELOG.md is updated

In case of adding a new rule:

  • README.md is updated
  • Rule has been applied on Ktlint itself and violations are fixed

@paul-dingemans paul-dingemans merged commit 0949748 into pinterest:master Jul 14, 2022
@paul-dingemans paul-dingemans deleted the 1491-callback-fixed-errors branch July 14, 2022 19:12
@paul-dingemans paul-dingemans added this to the 0.47.0 milestone Jul 14, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ktlint.format does not invoke callback for auto corrected errors
1 participant