From 49e06fb31abe18904d0915c4b4b1b36cf50b0929 Mon Sep 17 00:00:00 2001 From: Yuriy Losev Date: Wed, 25 Oct 2023 22:43:37 +0400 Subject: [PATCH] Ignore some files extensions --- pkg/utils/file/file.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/utils/file/file.go b/pkg/utils/file/file.go index 92e063b1..2a6c8dcc 100644 --- a/pkg/utils/file/file.go +++ b/pkg/utils/file/file.go @@ -47,6 +47,12 @@ func RecursiveGetExecutablePaths(dir string) ([]string, error) { return nil } + // ignore .yaml, .json, .txt, .md files + switch filepath.Ext(f.Name()) { + case ".yaml", ".json", ".md", ".txt": + return nil + } + if !IsFileExecutable(f) { log.Warnf("File '%s' is skipped: no executable permissions, chmod +x is required to run this hook", path) return nil