[PATCH v2 02/14] devtools: report all warnings in forbidden token check
David Marchand
david.marchand at redhat.com
Thu Sep 12 10:26:28 CEST 2024
Do not stop at the first file that got warnings.
Signed-off-by: David Marchand <david.marchand at 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
More information about the dev
mailing list