check-code: add support for walrus operator
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 27 Jan 2025 19:47:43 +0100
changeset 52738 e38292b85f9f
parent 52737 e5f97898122f
child 52739 f0c439952ecb
check-code: add support for walrus operator Lets step into the previous decade future !
contrib/check-code.py
--- a/contrib/check-code.py	Tue Jan 28 21:21:07 2025 +0100
+++ b/contrib/check-code.py	Mon Jan 27 19:47:43 2025 +0100
@@ -372,7 +372,7 @@
             r'\s(\+=|-=|!=|<>|<=|>=|<<=|>>=|%=)\S',
             "missing whitespace around operator",
         ),
-        (r'[^^+=*/!<>&| %-](\s=|=\s)[^= ]', "wrong whitespace around ="),
+        (r'[^^+=*/!<>&| %-:](\s=|=\s)[^= ]', "wrong whitespace around ="),
         (
             r'raise [^,(]+, (\([^\)]+\)|[^,\(\)]+)$',
             "don't use old-style two-argument raise, use Exception(message)",