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() {