-
Notifications
You must be signed in to change notification settings - Fork 741
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
Detekt #6038
Detekt #6038
Conversation
@ouchadam your test fun names are too long!
Unit Test Results0 files - 122 0 suites - 122 0s ⏱️ - 2m 8s Results for commit a312115. ± Comparison against base commit 3f8ddbe. This pull request removes 205 tests.
♻️ This comment has been updated with latest results. |
UserProperties fix is also in matrix-org/matrix-analytics-events#62
build.gradle
Outdated
// preconfigure defaults | ||
buildUponDefaultConfig = true | ||
// activate all available (even unstable) rules. | ||
allRules = false |
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.
we can generate a baseline if we want to enable more rules without having to fix them straight away https://detekt.dev/docs/introduction/baseline/
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.
Yes, thanks, I have seen that. Good to prevent new issues. I would prefer to enable the disabled rules one by one and fix the existing issues though.
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 have set this value to true
and the output is the same.
|
||
performance: | ||
SpreadOperator: | ||
active: false |
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 don't mind enabling this for production code but it can be handy to be able to use them in tests
detekt can be quite quick to run, on previous projects I've included it as part of the prebuild tasks to trigger detekt to run on every compile (makes the feedback loop super quick)
|
Detekt can also analyses documentation issues 🎉 , but this is disabled by default. I was looking for such tools when setting up To add to the file comments:
OutdatedDocumentation:
active: true
UndocumentedPublicClass:
active: true
UndocumentedPublicFunction:
active: true
UndocumentedPublicProperty:
active: true I will probably add those rules in the file now, but disabled by default, so that it can be handled in dedicated PRs (there are many issues :/). The top priority one will be |
It can be painful when developing to be blocked by for instance a temporary unused private fun (even if this specific rule is disabled now). On the other side, it's painful to not see the error locally, but only after the CI checks. We could have some |
having a script to run all our tools detekt, ktlint and the other code quality script would be helpful |
No new defect detected.
Matrix SDKIntegration Tests Results:
|
Let the CI fails first!
Now the CI should not fail.
This PR setup detekt and fix a few issues detected by detekt.
Some rule have been disabled temporarily, to avoid having too many changes.
Change on generated analytics file has been reported in matrix-org/matrix-analytics-events#62