From 38f11788a077842adc3350416515b3cc1fe73572 Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Wed, 27 Nov 2024 03:59:10 -0500 Subject: [PATCH] feat(healthcheck): log error on .gitignore error --- pkg/healthcheck/forbidden.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/healthcheck/forbidden.go b/pkg/healthcheck/forbidden.go index 37c70fc..6118c03 100644 --- a/pkg/healthcheck/forbidden.go +++ b/pkg/healthcheck/forbidden.go @@ -16,9 +16,13 @@ func getForbiddens(root string) ([]string, error) { var matches []string // Create a gitignore instance from the .gitignore file - ignore := gitignore.NewRepositoryWithCache(root, ".gitignore", gitignore.NewCache(), func(e gitignore.Error) bool { - return false - }) + ignore := gitignore.NewRepositoryWithCache( + root, ".gitignore", gitignore.NewCache(), + func(e gitignore.Error) bool { + slog.Error("gitignore error", "error", e) + return true + }, + ) err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { if err != nil {