mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
setup: add setup to make checks
- we've moved tmpctx management to setup.c from daemon.c, so we update the `check-tmpctx` - `common_setup(char *)` is now a valid analog for `setup_locale`, so we check for either in check-setup_locale
This commit is contained in:
parent
fbe50e087a
commit
66f59659a7
2
Makefile
2
Makefile
@ -358,7 +358,7 @@ check-setup_locale:
|
||||
@tools/check-setup_locale.sh
|
||||
|
||||
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
|
||||
@if git grep -n 'tal_free[(]tmpctx)' | grep -Ev '^ccan/|/test/|^common/setup.c:|^common/utils.c:'; then echo "Don't free tmpctx!">&2; exit 1; fi
|
||||
|
||||
check-discouraged-functions:
|
||||
@if git grep -E "[^a-z_/](fgets|fputs|gets|scanf|sprintf)\(" -- "*.c" "*.h" ":(exclude)ccan/"; then exit 1; fi
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
EXIT_CODE=0
|
||||
for FILE in $(git grep -lE 'int main\(' | grep -vE '^ccan/' | grep '.c$'); do
|
||||
if ! grep -q 'setup_locale();' "${FILE}"; then
|
||||
if ! grep -q -e 'setup_locale();' -e 'common_setup(argv\[0\]);' "${FILE}"; then
|
||||
echo "main(...) in ${FILE} does not call setup_locale() (see common/utils.h)"
|
||||
EXIT_CODE=1
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user