From 84d8f1fb74a457b90d50d0fab8059f9dfc60683e Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Thu, 24 Mar 2022 19:02:54 +0800 Subject: [PATCH] fix: fix suffix is a path issue --- .../src/main/kotlin/chapi/app/analyser/filter/FileFilter.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chapi-application/src/main/kotlin/chapi/app/analyser/filter/FileFilter.kt b/chapi-application/src/main/kotlin/chapi/app/analyser/filter/FileFilter.kt index a7a79bad..4502d0db 100644 --- a/chapi-application/src/main/kotlin/chapi/app/analyser/filter/FileFilter.kt +++ b/chapi-application/src/main/kotlin/chapi/app/analyser/filter/FileFilter.kt @@ -2,6 +2,7 @@ package chapi.app.analyser.filter import chapi.app.analyser.config.ChapiConfig import chapi.app.analyser.config.Language +import java.io.File open class FileFilter { companion object { @@ -10,6 +11,10 @@ open class FileFilter { return config.filterRule.toRegex().matches(path) } + if (!File(path).isFile) { + return false; + } + return when (config.language) { "java" -> { path.endsWith(".java")