Skip to content

Commit c8eb694

Browse files
Merge main into feature/dev-execution
2 parents ebfc9c2 + a2274c4 commit c8eb694

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/model/CodeModernizerSessionContext.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const val MAVEN_BUILD_SKIP_UNIT_TESTS = "clean test-compile"
5858
const val MAVEN_DEFAULT_BUILD_DIRECTORY_NAME = "target"
5959
const val IDEA_DIRECTORY_NAME = ".idea"
6060
const val GIT_DIRECTORY_NAME = ".git"
61+
const val GITHUB_DIRECTORY_NAME = ".github"
6162
const val DS_STORE_FILE_NAME = ".DS_Store"
6263
const val INVALID_SUFFIX_SHA = "sha1"
6364
const val INVALID_SUFFIX_REPOSITORIES = "repositories"
@@ -92,14 +93,12 @@ data class CodeModernizerSessionContext(
9293
return isMavenTargetDirName && hasPomSibling
9394
}
9495

95-
private fun File.isIdeaFolder(): Boolean = this.isDirectory && this.name == IDEA_DIRECTORY_NAME
96-
97-
private fun File.isGitFolder(): Boolean = this.isDirectory && this.name == GIT_DIRECTORY_NAME
96+
private fun File.isInvalidFolder(): Boolean = this.isDirectory && this.name in listOf(IDEA_DIRECTORY_NAME, GIT_DIRECTORY_NAME, GITHUB_DIRECTORY_NAME)
9897

9998
private fun findDirectoriesToExclude(sourceFolder: File): List<File> {
10099
val excluded = mutableListOf<File>()
101100
sourceFolder.walkTopDown().onEnter {
102-
if (it.isMavenTargetFolder() || it.isIdeaFolder() || it.isGitFolder()) {
101+
if (it.isMavenTargetFolder() || it.isInvalidFolder()) {
103102
excluded.add(it)
104103
return@onEnter false
105104
}

plugins/amazonq/codetransform/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/codemodernizer/CodeWhispererCodeModernizerSessionTest.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,14 @@ class CodeWhispererCodeModernizerSessionTest : CodeWhispererCodeModernizerTestBa
335335
}
336336

337337
@Test
338-
fun `CodeModernizerSession can create zip and excludes idea folder`() {
338+
fun `CodeModernizerSession can create zip and excludes idea folder and github folder`() {
339339
addFilesToProjectModule(
340340
"pom.xml",
341341
"src/tmp.java",
342342
".idea/smth.iml",
343343
"someModule/pom.xml",
344-
"someModule/.idea/smthelse.iml"
344+
"someModule/.idea/smthelse.iml",
345+
"someModule/.github/test.txt"
345346
)
346347
// get project.projectFile because project.projectFile can not be null
347348
val rootManager = ModuleRootManager.getInstance(module)

0 commit comments

Comments
 (0)