From 5f3631916a7b994fe16fd4e1402f2c4ceb3bfc0d Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 22 Apr 2021 14:56:54 -0700 Subject: [PATCH] Makefile: amend lint with pr_perror/fail checks In many cases developers forget that pr_perror and fail macros are a bit special, in particular: 1. they already show errno; 2. they already append \n to the message. Signed-off-by: Kir Kolyshkin --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index b627c2099..6de731bd6 100644 --- a/Makefile +++ b/Makefile @@ -404,6 +404,13 @@ lint: shellcheck scripts/*.sh shellcheck scripts/ci/*.sh scripts/ci/apt-install shellcheck test/others/crit/*.sh + # Do not append \n to pr_perror or fail + ! git --no-pager grep -E '^\s*\<(pr_perror|fail)\>.*\\n"' + # Do not use %m with pr_perror or fail + ! git --no-pager grep -E '^\s*\<(pr_perror|fail)\>.*%m' + # Do not use errno with pr_perror or fail + ! git --no-pager grep -E '^\s*\<(pr_perror|fail)\>\(".*".*errno' +.PHONY: lint codecov: SHELL := $(shell which bash) codecov: