Skip to content
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

MatchingDeclarationName. KtFilesSpec also remove .common.kt suffix from kotlin files #5851

Merged

Conversation

lexa-diky
Copy link
Contributor

No changes for rule itself, but MatchingDeclarationName now will threat .common.kt suffix as known kotlin file part.

@codecov
Copy link

codecov bot commented Feb 27, 2023

Codecov Report

Merging #5851 (f1cb616) into main (5d45cba) will increase coverage by 0.09%.
The diff coverage is 100.00%.

❗ Current head f1cb616 differs from pull request most recent head 99d84f9. Consider uploading reports for the commit 99d84f9 to get more accurate results

@@             Coverage Diff              @@
##               main    #5851      +/-   ##
============================================
+ Coverage     84.48%   84.58%   +0.09%     
- Complexity     3743     3785      +42     
============================================
  Files           546      546              
  Lines         12788    12941     +153     
  Branches       2230     2276      +46     
============================================
+ Hits          10804    10946     +142     
+ Misses          869      862       -7     
- Partials       1115     1133      +18     
Impacted Files Coverage Δ
...ls/src/main/kotlin/io/github/detekt/psi/KtFiles.kt 81.81% <100.00%> (+4.89%) ⬆️
.../github/detekt/test/utils/KotlinScriptException.kt 0.00% <0.00%> (-100.00%) ⬇️
.../detekt/rules/naming/ConstructorParameterNaming.kt 88.57% <0.00%> (-5.88%) ⬇️
...io/gitlab/arturbosch/detekt/core/rules/RuleSets.kt 89.65% <0.00%> (-3.45%) ⬇️
...turbosch/detekt/rules/style/UnusedPrivateMember.kt 88.99% <0.00%> (-3.24%) ⬇️
...sch/detekt/rules/coroutines/SleepInsteadOfDelay.kt 74.00% <0.00%> (-1.87%) ⬇️
...io/gitlab/arturbosch/detekt/core/KtTreeCompiler.kt 77.41% <0.00%> (-1.37%) ⬇️
...in/io/github/detekt/tooling/api/FunctionMatcher.kt 86.30% <0.00%> (-1.20%) ⬇️
...gitlab/arturbosch/detekt/core/config/YamlConfig.kt 87.87% <0.00%> (-1.02%) ⬇️
... and 43 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@BraisGabin BraisGabin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! I just left some minor things.


val PsiFile.fileName: String
get() = name.substringAfterLast(File.separatorChar)

/**
* Removes kotlin specific file name suffixes, e.g. .kt.
* Note, will note remove other possible/knowb file suffixes like .java
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Note, will note remove other possible/knowb file suffixes like .java
* Note, will not remove other possible/knowb file suffixes like .java

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, also knowb -> known

@@ -10,16 +10,29 @@ import java.nio.file.Paths

const val KOTLIN_SUFFIX = ".kt"
const val KOTLIN_SCRIPT_SUFFIX = ".kts"
const val KOTLIN_KMP_COMMON_SUFFIX = ".common.kt"

val KOTLIN_FILE_SUFFIXES = arrayOf(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val KOTLIN_FILE_SUFFIXES = arrayOf(
private val KOTLIN_FILE_SUFFIXES = arrayOf(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -10,16 +10,29 @@ import java.nio.file.Paths

const val KOTLIN_SUFFIX = ".kt"
const val KOTLIN_SCRIPT_SUFFIX = ".kts"
const val KOTLIN_KMP_COMMON_SUFFIX = ".common.kt"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const val KOTLIN_KMP_COMMON_SUFFIX = ".common.kt"
private const val KOTLIN_KMP_COMMON_SUFFIX = ".common.kt"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@github-actions github-actions bot removed the api label Feb 27, 2023
@BraisGabin BraisGabin added this to the 1.23.0 milestone Feb 28, 2023
@BraisGabin BraisGabin merged commit 96c91f2 into detekt:main Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants