-
-
Notifications
You must be signed in to change notification settings - Fork 803
Introduce parser and psi module #2716
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2716 +/- ##
============================================
- Coverage 80.55% 80.54% -0.01%
- Complexity 2317 2322 +5
============================================
Files 378 380 +2
Lines 6928 6940 +12
Branches 1255 1256 +1
============================================
+ Hits 5581 5590 +9
- Misses 721 723 +2
- Partials 626 627 +1
Continue to review full report at Codecov.
|
import org.jetbrains.kotlin.psi.KtElement | ||
import org.jetbrains.kotlin.psi.KtFile | ||
import org.jetbrains.kotlin.psi.KtPackageDirective | ||
import java.nio.file.Paths | ||
|
||
/** |
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.
⚠️ The classInvalidPackageDeclaration
is using inheritance, consider using composition instead. DoesInvalidPackageDeclaration
want to expose the complete interface (report, report, visitCondition
) ofRule
such thatInvalidPackageDeclaration
can be used whereRule
is expected? Indicates inheritance. DoesInvalidPackageDeclaration
want only some/part of the behavior exposed byRule
? Indicates Composition.
Generated by 🚫 Danger Kotlin against 04bde63 |
@@ -1,12 +1,11 @@ | |||
package io.gitlab.arturbosch.detekt.api | |||
|
|||
import io.github.detekt.psi.absolutePath |
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.
Should we keep this in a internal
package?
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.
Maybe it will get hidden behind a implementation
configuration later. I will keep this in mind.
@@ -0,0 +1,11 @@ | |||
dependencies { | |||
api(kotlin("compiler-embeddable")) |
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.
Couldn't this be implementation?
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.
Unfortunately not yet. I will see if this can be done in further PRs.
First steps towards cleaner api module and a common core module for Gradle/Sonar/IntelliJ/Compiler-Plugins and Cli module - #2680.
This PR gets rid of our usage of the kotlin compiler internal stuff from our api module.
The api module only references Psi classes inherited inside the Rule/DetektVisitor class.
Nice to have: my hope by introducing simpler modules is to get rid of all the build dependencies for
detekt-test
which all modules uses as a test implementation dependency. This slows down our build because all parallel threads have to wait until detekt-test is build to start testing.