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 <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2021-04-22 14:56:54 -07:00 committed by Andrei Vagin
parent 4cd23083be
commit 5f3631916a

View file

@ -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: