pinterest / ktlint

An anti-bikeshedding Kotlin linter with built-in formatter
https://pinterest.github.io/ktlint/
MIT License
6.06k stars 504 forks source link

Fix suppression handling when 'formatter:on' not properly specified #2719

Closed paul-dingemans closed 5 days ago

paul-dingemans commented 5 days ago

Description

Fix suppression handling when 'formatter:on' not properly specified

If the 'formatter:on' tag is not specified in the same scope as the 'formatter:off' tag, then the IndentationRule might throw an exception as the IndentationContextStack is not properly cleaned.

Also, cleaned up of CommentSuppressionHint.EOL type as it was not used since replacing the EOL suppression hints in 1.0 release.

Closes #2695

Checklist

Before submitting the PR, please check following (checks which are not relevant may be ignored):

Documentation is updated. See difference between snapshot and release documentation