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
MODELIX-794: adapt the detekt configuration according to the discussions from the coding conventions workshop #670
Conversation
Test Results122 files +1 122 suites +1 8m 0s ⏱️ +39s Results for commit 688bed5. ± Comparison against base commit 19e7e52. This pull request removes 3 and adds 1 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
JVM coverage report
|
Part of: MODELIX-794
Part of: MODELIX-794
In multiplatform modules, the detekt task does not include tasks for JVM and JS source sets.
GitHub only allows 20 SARIF runs in a single upload. However, our number of modules already exceeds this limit. Therefore, we combine the resulting detekt sarif files into a single file with only a single run, which circumvents this limit.
aa0c47a
to
7116244
Compare
import io.gitlab.arturbosch.detekt.api.Severity | ||
import org.jetbrains.kotlin.psi.KtReferenceExpression | ||
|
||
class AvoidNonNullAssertionOperator(config: Config) : Rule(config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting how custom rules can be added.
But according to detekt/detekt#4832 it can be replaced by UnnecessaryNotNullOperator
and UnsafeCallOnNullableType
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UnsafeCallOnNullableType is active by default but doesn't catch all of the cases the custom rule is reporting on. For whatever reason....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried it again, even with actively enabling those two rules, despite the fact that they should be active by default, I can't get a single report from them. Not sure if that's a detekt bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thist might be realted to type resolution.
See detekt/detekt#2036 (comment)
See https://detekt.github.io/detekt/type-resolution.html
f60c055
to
8f9aa0c
Compare
The `knownPerformanceIssue` test case was now constantly timing out when being executed in JS. After clarification, all corner cases it included are already covered by the remaining tests in the test file and also by MergeOrderTest, ConflictResolutionTest, and UndoTest. Therefore, I have dropped this test case to avoid the timeout and to reduce the amount of hard to maintain test cases. The expensive part about the test was the way assertHistoryIsCorrect was implemented, not the production code.
No public visibility needed here.
8f9aa0c
to
688bed5
Compare
🎉 This PR is included in version 7.3.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Updates detekt to:
I've also fixed a bug in CI where multiplatform code was not linted due to the
detekt
target not including multiplatform targets.