From cdd60c65da18df73a2df35bc0b25b68dfea00e40 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Sat, 23 Dec 2023 17:54:09 -0700 Subject: [PATCH] pre-commit: ban Msgf() from zerolog Signed-off-by: Sumner Evans --- .pre-commit-config.yaml | 8 +++++++- dbutil/log.go | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1ef386e..c8a750c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: trailing-whitespace exclude_types: [markdown] @@ -13,3 +13,9 @@ repos: hooks: - id: go-imports-repo - id: go-vet-repo-mod + + - repo: https://github.com/beeper/pre-commit-go + rev: v0.2.2 + hooks: + - id: zerolog-ban-msgf + types: [ file ] diff --git a/dbutil/log.go b/dbutil/log.go index bd49326..ce0e1f7 100644 --- a/dbutil/log.go +++ b/dbutil/log.go @@ -125,5 +125,5 @@ func (z zeroLogger) QueryTiming(ctx context.Context, method, query string, args } func (z zeroLogger) Warn(msg string, args ...interface{}) { - z.l.Warn().Msgf(msg, args...) + z.l.Warn().Msgf(msg, args...) // zerolog-allow-msgf }