From a039630da109aa88fb2743728f0ddb769e7ae82a Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 1 Aug 2018 12:32:25 +0200 Subject: [PATCH] lint: Add linter checking for use of discouraged standard library functions --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2979461a0..6dd52be24 100644 --- a/Makefile +++ b/Makefile @@ -286,7 +286,10 @@ check-setup_locale: check-tmpctx: @if git grep -n 'tal_free[(]tmpctx)' | grep -Ev '^ccan/|/test/|^common/daemon.c:|^common/utils.c:'; then echo "Don't free tmpctx!">&2; exit 1; fi -check-source: check-makefile check-source-bolt check-whitespace check-markdown check-spelling check-python check-includes check-cppcheck check-shellcheck check-setup_locale check-tmpctx +check-discouraged-functions: + @if git grep -E "[^a-z_/](fgets|fputs|gets|scanf|sprintf)\(" -- "*.c" "*.h" ":(exclude)ccan/"; then exit 1; fi + +check-source: check-makefile check-source-bolt check-whitespace check-markdown check-spelling check-python check-includes check-cppcheck check-shellcheck check-setup_locale check-tmpctx check-discouraged-functions full-check: check check-source