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

Feature request: Provide an ability to select older detekt version to make formatting rules backwards compatible #497

Open
sachin-tripactions opened this issue Oct 31, 2023 · 3 comments
Labels
feature New feature or request

Comments

@sachin-tripactions
Copy link

Currently there is no way to match detekt version between the one used in gradle dependencies and the plugin.
This matters because the formatting rules (ktlint) used in plugin is always latest while the codebase might be using an older version based on the given compatibility table: https://detekt.dev/docs/introduction/compatibility/#tool-versions.
Workaround we have been doing is to manually download an older version of plugin based on the release notes which is not very intuitive.

Requesting a feature where you get to choose detekt version (or formatting rules version specifically) which would somewhat look like this:
Screenshot 2023-10-30 at 10 22 28 PM

@arturbosch arturbosch added the feature New feature or request label Nov 5, 2023
@arturbosch
Copy link
Member

Related to #125.

Hm, if the plugin would not bundle the formatting jar I think your usecase could be solved by choosing the formatting jar a s a plugin jar.

I wonder if it is possible to bundle an extra jar in the plugin zip and load it on demand but not on startup of the plugin.
Like an implicit plugin jar when the Enable formatting option is chosen.

@sachin-tripactions
Copy link
Author

sachin-tripactions commented Nov 5, 2023

your usecase could be solved by choosing the formatting jar a s a plugin jar

I tried this but it breaks the plugin completely somehow. Meaning, no issues gets detected on the fly if I choose a suitable formatting jar in plugin jars manually. This could be a bug.

@arturbosch
Copy link
Member

your usecase could be solved by choosing the formatting jar a s a plugin jar

I tried this but it breaks the plugin completely somehow. Meaning, no issues gets detected on the fly if I choose a suitable formatting jar in plugin jars manually. This could be a bug.

Just to be sure, you forked the plugin, removed the formatting dependency and added the formatting jar as a plugin jar?

As the detekt plugin bundles the formatting jar by default, there could be some class conflicts if you just try to add another formatting jar version.

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

No branches or pull requests

2 participants