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

Extension toolVersion should default to the value from version.properties #4618

Closed
efenderbosch opened this issue Mar 8, 2022 · 1 comment · Fixed by #4623
Closed

Extension toolVersion should default to the value from version.properties #4618

efenderbosch opened this issue Mar 8, 2022 · 1 comment · Fixed by #4623

Comments

@efenderbosch
Copy link

Expected Behavior

extensions.findByType<DetektExtension>().toolVersion should return a non-null value, defaulting to the value present in version.properties

Current Behavior

extensions.findByType<DetektExtension>().toolVersion returns null if not explicitly configured

Context

I need this value because I'm writing a Gradle plugin to reduce boilerplate in our services and want to include the io.gitlab.arturbosch.detekt:detekt-formatting dependency, but can't use the extension's toolVersion to properly include the correct version.

I can workaround using this:

val detektVersion = Properties().run {
    load(DetektPlugin::class.java.classLoader.getResourceAsStream("versions.properties"))
    getProperty("detektVersion")
}
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:$detektVersion")

But referencing version.properties feels dirty and the plugin already reads this property file and could set the extension's toolVersion from that value.

@cortinico
Copy link
Member

Yup you're right. That's a "bug" on our end. The fix is here #4623

sschuberth added a commit to oss-review-toolkit/ort that referenced this issue Jun 16, 2022
This is not necessary anymore as of detekt 1.20.0, see [1].

[1]: detekt/detekt#4618

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
sschuberth added a commit to oss-review-toolkit/ort that referenced this issue Jun 16, 2022
This is not necessary anymore as of detekt 1.20.0, see [1].

[1]: detekt/detekt#4618

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
sschuberth added a commit to oss-review-toolkit/ort that referenced this issue Jun 16, 2022
This is not necessary anymore as of detekt 1.20.0, see [1].

[1]: detekt/detekt#4618

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
sschuberth added a commit to oss-review-toolkit/ort that referenced this issue Jun 17, 2022
This is not necessary anymore as of detekt 1.20.0, see [1].

[1]: detekt/detekt#4618

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
porsche-rbieniek pushed a commit to porsche-rbieniek/ort that referenced this issue Jun 24, 2022
This is not necessary anymore as of detekt 1.20.0, see [1].

[1]: detekt/detekt#4618

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
porsche-rbieniek pushed a commit to porsche-rbieniek/ort that referenced this issue Jun 27, 2022
This is not necessary anymore as of detekt 1.20.0, see [1].

[1]: detekt/detekt#4618

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
porsche-rbieniek pushed a commit to porsche-rbieniek/ort that referenced this issue Jun 27, 2022
This is not necessary anymore as of detekt 1.20.0, see [1].

[1]: detekt/detekt#4618

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
sschuberth added a commit to oss-review-toolkit/ort-workbench that referenced this issue Jul 13, 2022
This is not necessary anymore as of detekt 1.20.0, see [1].

[1]: detekt/detekt#4618

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
sschuberth added a commit to oss-review-toolkit/ort-workbench that referenced this issue Jul 13, 2022
This is not necessary anymore as of detekt 1.20.0, see [1].

[1]: detekt/detekt#4618

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants