Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Please make RuleExecutionException (or KtLintRuleExecutionException) a part of the public API #1710

Closed
0x6675636b796f75676974687562 opened this issue Nov 18, 2022 · 4 comments
Milestone

Comments

@0x6675636b796f75676974687562
Copy link
Contributor

Diktat uses com.pinterest.ktlint.core.RuleExecutionException in its Maven plug-in.

Currently (0.47.1), RuleExecutionException is already deprecated while KtLintRuleExecutionException is not yet released.

Please provide either class as a public API.

Your Environment

  • Version of ktlint used: 0.47.1
  • Relevant parts of the .editorconfig settings: none
  • Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task): Kotlin API
  • Version of Gradle used (if applicable): N/A
  • Operating System and version: Windows 10, Debian Linux 11
@paul-dingemans
Copy link
Collaborator

This will be fixed as part of #1712. However, you will need to catch KtLintRuleException.

@paul-dingemans paul-dingemans added this to the 0.48.0 milestone Nov 20, 2022
@0x6675636b796f75676974687562
Copy link
Contributor Author

@paul-dingemans, thank you for your response.

Can you confirm KtLintRuleExecutionException will be gone in 0.48, and KtLintRuleException is the new API to use?

@paul-dingemans
Copy link
Collaborator

Yes that is correct. KtLintRuleException and KtLintParseException are the public exceptions that the KtLint API will throw. The KtLintRuleExecutionException is an internal exception that will be exposed as KtLintRuleException.

@paul-dingemans
Copy link
Collaborator

This was already solved in #1704 and #1707. See https://github.com/pinterest/ktlint/pull/1707/files#diff-c45ac8e5f023e5910a6c61b4b9f0c41ae44383db9b77b164a0db2adcb85fc7b0. Note however that the exception is now located in package package com.pinterest.ktlint.core.api.

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

No branches or pull requests

2 participants