-
Notifications
You must be signed in to change notification settings - Fork 100
Add detekt static analysis #47
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,8 @@ object Versions { | |
|
|
||
| const val org_jetbrains_kotlin: String = "1.3.41" // available: "1.3.50" | ||
|
|
||
| const val io_gitlab_arturbosch_detekt: String = "1.0.1" | ||
|
|
||
| /** | ||
| * | ||
| * See issue 19: How to update Gradle itself? | ||
|
|
@@ -55,3 +57,7 @@ object Versions { | |
| val PluginDependenciesSpec.buildSrcVersions: PluginDependencySpec | ||
| inline get() = | ||
| id("de.fayard.buildSrcVersions").version(Versions.de_fayard_buildsrcversions_gradle_plugin) | ||
|
|
||
| val PluginDependenciesSpec.detekt: PluginDependencySpec | ||
| inline get() = | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. First time I see the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Haha thanks! Honestly, I just saw this in the previous line and did a quick search for usefulness. Turns out inline getters are quite handy, so I kept it. |
||
| id("io.gitlab.arturbosch.detekt").version(Versions.io_gitlab_arturbosch_detekt) | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
How about adding also test files?
Something like:
input = files( "src/main/java", "src/test/java", "src/androidTest/java", )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.
In my experience, the test files cause more warnings for the way they are written. I know it sounds like an excuse but it happens for example on methods or names.
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 agree with @sierisimo. I have used static analysis tools with test code before and it really looks bad if your CI pipeline fails because of code smells in your test code.
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 it's harder to keep maintainability on tests, and while I haven't been in a situation where this has been a real problem, I understand your concerns. LGTM :)