From 7b8d2bf2127846bd7ad82d0d5932bcb0a73e0101 Mon Sep 17 00:00:00 2001 From: "Ivan.Makeev" Date: Fri, 22 Nov 2024 11:06:05 +0400 Subject: [PATCH] * check globs excludes in no-cyrillic linter Signed-off-by: Ivan.Makeev --- README.md | 1 + pkg/linters/no-cyrillic/no-cyrillic.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a1a959..0137666 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ linters-settings: no-cyrillic-file-excludes: - user-authz:/rbac.yaml - documentation:/images/web/site/_data/topnav.yml + - other-module:/external/**/*.txt license: copyright-excludes: - upmeter:/images/upmeter/stress.sh diff --git a/pkg/linters/no-cyrillic/no-cyrillic.go b/pkg/linters/no-cyrillic/no-cyrillic.go index ff57763..3ce38f7 100644 --- a/pkg/linters/no-cyrillic/no-cyrillic.go +++ b/pkg/linters/no-cyrillic/no-cyrillic.go @@ -66,7 +66,7 @@ func (o *NoCyrillic) Run(m *module.Module) (errors.LintRuleErrorsList, error) { for _, fileName := range files { name, _ := strings.CutPrefix(fileName, m.GetPath()) name = m.GetName() + ":" + name - if slices.Contains(o.cfg.NoCyrillicFileExcludes, name) { + if fsutils.FileNameMatchAnyMask(name, o.cfg.NoCyrillicFileExcludes) { continue } if o.skipDocRe.MatchString(fileName) {