From 13759f7445800856112ad1ed3306b3baa60f73f6 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Tue, 24 Oct 2023 07:40:04 +0200 Subject: fix: Ignore some non sec issues --- .githooks/pre-commit | 2 +- cmd/gettext/gettext.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 92a43ad..6a353fc 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -4,7 +4,7 @@ set -ev templ generate gofmt -d -e -s . go vet ./... -go run ./tools/cvet ./... +go run github.com/martinlehoux/kagamigo/cmd/cvet ./... staticcheck ./... gosec -quiet ./... gocyclo -over 10 -ignore '.*_templ\.go' . diff --git a/cmd/gettext/gettext.go b/cmd/gettext/gettext.go index 7abb6e2..b753da8 100644 --- a/cmd/gettext/gettext.go +++ b/cmd/gettext/gettext.go @@ -97,7 +97,7 @@ func extractAllKeys() map[string]int { err := filepath.Walk("templates", func(path string, info fs.FileInfo, err error) error { if !info.IsDir() && filepath.Ext(path) == ".html" { - content, err := os.ReadFile(path) + content, err := os.ReadFile(path) // #nosec G304 core.Expect(err, "error reading file") for key, value := range extractKeys(string(content)) { extractedKeys[key] = value @@ -124,7 +124,7 @@ func main() { currentLocales := make(map[string]string, 0) newLocales := make(map[string]string, 0) - locales, err := os.ReadFile(filepath.Join("locales", lang, "index.yml")) + locales, err := os.ReadFile(filepath.Join("locales", lang, "index.yml")) // #nosec G304 core.Expect(err, "error reading file") core.Expect(yaml.Unmarshal(locales, ¤tLocales), "error unmarshalling yaml") -- cgit v1.3