Skip to content

Commit

Permalink
Adding more extensions and no extension files to test generation usec…
Browse files Browse the repository at this point in the history
…ase ignore list. (#5389)
  • Loading branch information
ashishrp-aws authored Feb 19, 2025
1 parent 93b3b5a commit f0911c4
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ class GitIgnoreFilteringUtil(
"*.a",
"*.map",
"*.graph",
"*.so"
"*.so",
"*.csv",
"*.dylib",
"*.parquet",
"*.xlsx"
)
)
}
Expand Down Expand Up @@ -101,6 +105,18 @@ class GitIgnoreFilteringUtil(

suspend fun ignoreFile(file: VirtualFile): Boolean {
// this method reads like something a JS dev would write and doesn't do what the author thinks

// ignores no extension files for test generation use case.
val allowedNoExtFiles = setOf("Config", "Dockerfile", "README")
if (useCase == CodeWhispererConstants.FeatureName.TEST_GENERATION &&
!file.isDirectory &&
file.extension.isNullOrEmpty() &&
!allowedNoExtFiles.any {
it.equals(file.name, ignoreCase = true)
}
) {
return true
}
val deferredResults = ignorePatternsWithGitIgnore.map { pattern ->
withContext(coroutineContext) {
// avoid partial match (pattern.containsMatchIn) since it causes us matching files
Expand Down

0 comments on commit f0911c4

Please sign in to comment.