Skip to content

Commit

Permalink
feat: remove before multiple \n
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 18, 2023
1 parent 54c5f47 commit cc62f95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ class JavaSimilarChunker(private val fileTree: HashMap<String, InstructionFileJo
similarChunks.take(3)
} else {
similarChunks
}.map {
// clean up the similar chunks, if start with multiple \n, remove to one
it.replace(Regex("^\\n+"), "\n")
}

return SimilarChunkContext("java", relatedCodePath, similarChunksText)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public class HelloController {

Assertions.assertEquals(
first.similarChunks.joinToString("\n"), """
@Repository
public interface BlogRepository extends CrudRepository<BlogPost, Long> {
Expand Down

0 comments on commit cc62f95

Please sign in to comment.