Mercurial > public > mercurial-scm > hg-stable
diff contrib/check-code.py @ 52752:e38292b85f9f
check-code: add support for walrus operator
Lets step into the previous decade future !
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 27 Jan 2025 19:47:43 +0100 |
parents | 24ee91ba9aa8 |
children |
line wrap: on
line diff
--- 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)",