Skip to content

Function to return supported Kotlin version#6472

Merged
BraisGabin merged 17 commits into
detekt:mainfrom
kkocel:main
Oct 4, 2023
Merged

Function to return supported Kotlin version#6472
BraisGabin merged 17 commits into
detekt:mainfrom
kkocel:main

Conversation

@kkocel

@kkocel kkocel commented Sep 7, 2023

Copy link
Copy Markdown
Contributor

Introduce the function that returns the supported Kotlin version as mentioned in: #6198 (comment)

@codecov

codecov Bot commented Sep 7, 2023

Copy link
Copy Markdown

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (348cea0) 85.18% compared to head (8983a58) 85.18%.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #6472   +/-   ##
=========================================
  Coverage     85.18%   85.18%           
  Complexity     4037     4037           
=========================================
  Files           564      564           
  Lines         13273    13273           
  Branches       2387     2387           
=========================================
  Hits          11306    11306           
  Misses          773      773           
  Partials       1194     1194           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@3flex 3flex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just want to note that while this will work in the majority of cases it is possible to change the version of detekt-cli that the plugin calls, and the resolved version of the CLI dependency might depend on a different Kotlin version which will cause failures again.

I think we can get the resolved Kotlin dependency version from Gradle though when I last tried this it didn't seem that easy. But in the meantime annotating with Incubating will at least flag in IDE that this isn't 100% stable or foolproof.

@kkocel

kkocel commented Sep 8, 2023

Copy link
Copy Markdown
Contributor Author

I just want to note that while this will work in the majority of cases it is possible to change the version of detekt-cli that the plugin calls, and the resolved version of the CLI dependency might depend on a different Kotlin version which will cause failures again.

I thought about adding dependency to detekt-cli and query supported version from there, but I assumed that Kotlin versions would be consistent across modules.

@kkocel

kkocel commented Sep 11, 2023

Copy link
Copy Markdown
Contributor Author

@3flex is there anything here that I should change or it's good to be merged?

@BraisGabin BraisGabin added the pick request Marker for PRs that should be ported to the 1.0 release branch label Sep 14, 2023
@BraisGabin BraisGabin added this to the 2.0.0 milestone Sep 14, 2023
@BraisGabin

Copy link
Copy Markdown
Member

I vote to merge this. They should not be unaligned. And if they do we could always change this implementation without any breaking change.

@BraisGabin

Copy link
Copy Markdown
Member

@kkocel could you also update the documentation pointing out how to use this workaround? And that it should only be needed if the user applies the spring dependency manager (I can't recall the exact name)

Add information about the Spring Dependency Management Plugin.
Update snippet to use Kotlin version resolution method.
@detekt-ci

detekt-ci commented Sep 25, 2023

Copy link
Copy Markdown
Collaborator
Warnings
⚠️

It looks like you're editing the un-versioned copy of our website. This affects only users on the 'next' version of detekt, and it's correct only if you intend to document a future change or feature. If you intended to make a change also for the current version of detekt, please make sure you edit the equivalent file inside website/versioned_docs/ as well.

Generated by 🚫 dangerJS against 8983a58

@kkocel

kkocel commented Sep 25, 2023

Copy link
Copy Markdown
Contributor Author

@BraisGabin thank you. I added the relevant part in the future docs and mentioned Spring Dependency Plugin there.

@vercel

vercel Bot commented Oct 3, 2023

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
detekt ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 3, 2023 6:12pm

@BraisGabin BraisGabin merged commit c40c299 into detekt:main Oct 4, 2023
cortinico pushed a commit that referenced this pull request Oct 30, 2023
* Function to return supported Kotlin version

* Update documentation

Add information about the Spring Dependency Management Plugin.
Update snippet to use Kotlin version resolution method.
mgroth0 pushed a commit to mgroth0/detekt that referenced this pull request Feb 11, 2024
* Function to return supported Kotlin version

* Update documentation

Add information about the Spring Dependency Management Plugin.
Update snippet to use Kotlin version resolution method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation gradle-plugin pick request Marker for PRs that should be ported to the 1.0 release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants