Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Ensure Kotlin compilation task reruns when detekt config changes #23

Merged
merged 2 commits into from
Sep 26, 2020

Conversation

3flex
Copy link
Member

@3flex 3flex commented Sep 10, 2020

Fixes #16

This is definitely a bit of a hack, but until KT-41711 is resolved, I can't see a better option. I think the compiler plugin needs this feature because behaviour is surprising otherwise - you would reasonably expect a config file change would take effect the next time a compilation task is run.

.fold(byteArrayOf()) { acc, file -> acc + file }

return Base64.getEncoder().encodeToString(
MessageDigest.getInstance("SHA-256").digest(concatenatedConfig)
Copy link
Member

Choose a reason for hiding this comment

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

We could use DigestInputStream or something similar so we don't need to copy all the file in memory to compute the sha. But thinking about what detekt and the Compiler does this is clearly nothing so 🤐.

@arturbosch arturbosch merged commit 60b51f1 into detekt:master Sep 26, 2020
@3flex 3flex deleted the 16-fix branch September 26, 2020 23:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

detekt analysis doesn't run when changing config after clean compile
4 participants