-
-
Notifications
You must be signed in to change notification settings - Fork 755
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
useDefaultConfig on tests #6841
Conversation
...mpiler-plugin/src/main/kotlin/io/github/detekt/compiler/plugin/DetektCommandLineProcessor.kt
Outdated
Show resolved
Hide resolved
|
d4c0932
to
9e5ed30
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6841 +/- ##
============================================
+ Coverage 84.89% 85.44% +0.54%
- Complexity 3888 3892 +4
============================================
Files 574 574
Lines 12919 12919
Branches 2448 2448
============================================
+ Hits 10968 11038 +70
+ Misses 724 655 -69
+ Partials 1227 1226 -1 ☔ View full report in Codecov by Sentry. |
9e5ed30
to
5826b53
Compare
@@ -95,14 +94,15 @@ val testPluginKotlinc by tasks.registering(Task::class) { | |||
sourceFile.path, | |||
"-Xplugin=${tasks.shadowJar.get().archiveFile.get().asFile.absolutePath}", | |||
"-P", | |||
"plugin:detekt-compiler-plugin:debug=true".toArg(), | |||
"-P", | |||
"plugin:detekt-compiler-plugin:useDefaultConfig=true".toArg(), |
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.
Is this necessary? As it seems you're hardcoding the value to true inside CompilerTestUtils
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 is. This gradle task is "test" task. But it is not related at all with the unit tests. So I need this too. They are two unrelated codes that relies on that "not defined" behaviour.
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.
Ahh I see, thanks for clarifying
@detekt/maintainers a review here would help a lot I have other PRs pending to this. |
* useDefaultConfig on tests * useDefaultConfig on testPluginKotlinc
Right now the tests of
detekt-compiler-plugin
relies in an "undefined behavior" of the core. They don't define a configuration nor useuseDefaultConfig=true
, so no rule should be run. Every rule is disabled by default unless you define the configuration or haveuseDefaultConfig=true
.I want to refactor how the configuration is created on
detekt-core
and remove that "undefined behaviour". For that reason I need to fix these tests to passuseDefaultConfig=true
.