Repository navigation
detekt flags code I didn't touch. Do I fix it, suppress it or rebuild the baseline? #617
Answered
by
lumenpearson
lumenpearson
asked this question in
Q&A
|
|
Answered by
lumenpearson
Oct 17, 2026
Replies: 1 comment
|
Applies to: any version — this is how the project works by design. It depends on why detekt now sees the finding. Each module's
The few rules switched off for Compose are in
A change to that file changes the rules for all five modules, so argue for it in the pull request rather than as a side effect. More: https://github.com/lumenpearson/lessons/blob/main/docs/build.md#detekt |
0 replies
Answer selected by
lumenpearson
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Applies to: any version — this is how the project works by design.
It depends on why detekt now sees the finding. Each module's
detekt-baseline.xmlforgives the findings the code already had. A baseline entry names the rule, the file and the declaration, not the line.mainthat moved code, makes old findings come back as new ones. Run./gradlew detektBaseline. It rewrites all five baselines from the code as it stands and drops entries for findings since fixed. Run it after the merge, in a commit with nothing else in it, so that the review of the baseline shows only moved entries. A renamed declaration comes back the same way, …