File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
src/main/kotlin/com/github/blarc/gitlab/template/lint/plugin Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 22
33## [ Unreleased]
44
5+ ### Fixed
6+ - Prevent ` InvalidPathException ` being raised in ` GitlabLintUtils.matchesGlobs ` .
7+
58## [ 1.13.0] - 2023-05-18
69
710### Added
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import com.intellij.openapi.project.Project
1111import com.intellij.openapi.vfs.VirtualFile
1212import com.intellij.openapi.wm.WindowManager
1313import java.nio.file.FileSystems
14+ import java.nio.file.InvalidPathException
1415
1516object GitlabLintUtils {
1617 fun isGitlabYaml (file : VirtualFile ): Boolean {
@@ -40,8 +41,11 @@ object GitlabLintUtils {
4041 val fileSystem = FileSystems .getDefault()
4142 for (globString in globs) {
4243 val glob = fileSystem.getPathMatcher(" glob:$globString " )
43- if (glob.matches(fileSystem.getPath(text))) {
44- return true
44+ try {
45+ return glob.matches(fileSystem.getPath(text))
46+ }
47+ catch (e: InvalidPathException ) {
48+ return false
4549 }
4650 }
4751 return false
You can’t perform that action at this time.
0 commit comments