diff --git a/dist/tools/buildsystem_sanity_check/check.sh b/dist/tools/buildsystem_sanity_check/check.sh index a7ebe0f18c..d152251381 100755 --- a/dist/tools/buildsystem_sanity_check/check.sh +++ b/dist/tools/buildsystem_sanity_check/check.sh @@ -349,6 +349,19 @@ check_no_riot_config() { | error_with_message "Don't push RIOT_CONFIG_* definitions upstream. Rather define configuration via Kconfig" } +check_stderr_null() { + local patterns=() + local pathspec=() + + patterns+=(-e '2>[[:blank:]]*&1[[:blank:]]*>[[:blank:]]*/dev/null') + + pathspec+=('Makefile*') + pathspec+=('**/Makefile*') + pathspec+=('**/*.mk') + git -C "${RIOTBASE}" grep -n "${patterns[@]}" -- "${pathspec[@]}" \ + | error_with_message "Redirecting stderr and stdout to /dev/null is \`>/dev/null 2>&1\`; the other way round puts the old stderr to the new stdout." +} + error_on_input() { ! grep '' } @@ -369,6 +382,7 @@ all_checks() { check_no_usemodules_in_makefile_include check_no_pkg_source_local check_no_riot_config + check_stderr_null } main() {