Re: [PATCH v5] coccinelle: misc: Add field_modify script

From: Luo Jie
Date: Wed Jun 25 2025 - 02:27:43 EST




On 6/24/2025 9:54 PM, Markus Elfring wrote:
+msg="WARNING: Consider using FIELD_MODIFY helper on %s" % (x)
+msg_safe=msg.replace("[","@(").replace("]",")")
+coccilib.org.print_todo(p[0], msg_safe)

How do you think about to use the following code variant instead?

msg = f"WARNING: Consider using FIELD_MODIFY helper on {x}"
coccilib.org.print_todo(p[0], msg.replace("[","@(").replace("]",")"))


I think your proposed variant is a better alternative. I will adopt
it in the next revision. Thanks.


Regards,
Markus