Do not stop at the first file that got warnings.

Signed-off-by: David Marchand <david.march...@redhat.com>
---
 devtools/check-forbidden-tokens.awk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/devtools/check-forbidden-tokens.awk 
b/devtools/check-forbidden-tokens.awk
index 807dad7f48..d72d244d3a 100755
--- a/devtools/check-forbidden-tokens.awk
+++ b/devtools/check-forbidden-tokens.awk
@@ -13,6 +13,7 @@ BEGIN {
        in_file=0;
        in_comment=0;
        count=0;
+       warned=0;
        comment_start="/*"
        comment_end="*/"
 }
@@ -50,7 +51,8 @@ BEGIN {
 ($0 ~ "^\\+\\+\\+ b/") {
        in_file = 0;
        if (count > 0) {
-               exit;
+               warned = warned + 1
+               print "Warning in " substr(last_file,7) ":"
        }
        count = 0
        for (i in deny_folders) {
@@ -66,7 +68,10 @@ BEGIN {
 }
 END {
        if (count > 0) {
+               warned = warned + 1
                print "Warning in " substr(last_file,7) ":"
+       }
+       if (warned > 0) {
                print MESSAGE
                exit RET_ON_FAIL
        }
-- 
2.46.0

Reply via email to