-
-
Notifications
You must be signed in to change notification settings - Fork 774
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
Allow detekt to run on kts too. #628
Conversation
@@ -39,7 +39,7 @@ class KtTreeCompiler(private val compiler: KtCompiler = KtCompiler(), | |||
private fun Path.isKotlinFile(): Boolean { | |||
val fullPath = this.toAbsolutePath().toString() | |||
val kotlinEnding = fullPath.substring(fullPath.lastIndexOf('.') + 1) | |||
return kotlinEnding.length == 2 && kotlinEnding.endsWith("kt") | |||
return kotlinEnding == "kt" || kotlinEnding == "kts" |
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.
Please test for .kt
and .kts
or files like config.detekt
will get analyzed too ^^
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.
oh sorry, my fault the kotlinEnding line does the split
Please add a test case where a kotlin script is successfully compiled. |
Sure, where's the place for that? |
Ok, the KtTreeCompiler does the Furthermore please change this line |
|
Well the script name is |
Fixes #612
Let's hope it'll be that easy