From dff6e35572de5264c75c29797bb7734da88dc507 Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Tue, 10 Jun 2025 21:20:21 -0400 Subject: [PATCH] feat(healthcheck): use simpler ignore.Match --- pkg/healthcheck/forbidden.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkg/healthcheck/forbidden.go b/pkg/healthcheck/forbidden.go index 912bf80..165ff53 100644 --- a/pkg/healthcheck/forbidden.go +++ b/pkg/healthcheck/forbidden.go @@ -32,12 +32,7 @@ func getForbiddens(root string) ([]string, error) { return nil } } - // Get the relative path to the git repo root - relPath, err := filepath.Rel(root, path) - if err != nil { - return err - } - match := ignore.Relative(relPath, true) + match := ignore.Match(path) // Check if the relative file path should be ignored based on the .gitignore rules if match != nil && match.Ignore() {