Skip to content

Commit cb3fa1e

Browse files
author
Markus Armbruster
committed
coccinelle/err-bad-newline: Fix for Python 3, and add patterns
Signed-off-by: Markus Armbruster <[email protected]> Message-Id: <[email protected]> Reviewed-by: Eric Blake <[email protected]>
1 parent 09e0cd7 commit cb3fa1e

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed
Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,42 @@
11
// Error messages should not contain newlines. This script finds
22
// messages that do. Fixing them is manual.
33
@r@
4-
expression errp, eno, cls, fmt;
4+
expression errp, err, eno, cls, fmt, ap;
55
position p;
66
@@
77
(
8+
error_vreport(fmt, ap)@p
9+
|
10+
warn_vreport(fmt, ap)@p
11+
|
12+
info_vreport(fmt, ap)@p
13+
|
814
error_report(fmt, ...)@p
915
|
16+
warn_report(fmt, ...)@p
17+
|
18+
info_report(fmt, ...)@p
19+
|
20+
error_report_once(fmt, ...)@p
21+
|
22+
warn_report_once(fmt, ...)@p
23+
|
1024
error_setg(errp, fmt, ...)@p
1125
|
1226
error_setg_errno(errp, eno, fmt, ...)@p
1327
|
1428
error_setg_win32(errp, eno, cls, fmt, ...)@p
1529
|
30+
error_propagate_prepend(errp, err, fmt, ...)@p
31+
|
32+
error_vprepend(errp, fmt, ap)@p
33+
|
1634
error_prepend(errp, fmt, ...)@p
1735
|
1836
error_setg_file_open(errp, eno, cls, fmt, ...)@p
1937
|
38+
warn_reportf_err(errp, fmt, ...)@p
39+
|
2040
error_reportf_err(errp, fmt, ...)@p
2141
|
2242
error_set(errp, cls, fmt, ...)@p
@@ -26,4 +46,4 @@ fmt << r.fmt;
2646
p << r.p;
2747
@@
2848
if "\\n" in str(fmt):
29-
print "%s:%s:%s:%s" % (p[0].file, p[0].line, p[0].column, fmt)
49+
print("%s:%s:%s:%s" % (p[0].file, p[0].line, p[0].column, fmt))

0 commit comments

Comments
 (0)