Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
52751:e5f97898122f | 52752:e38292b85f9f |
---|---|
370 ), | 370 ), |
371 ( | 371 ( |
372 r'\s(\+=|-=|!=|<>|<=|>=|<<=|>>=|%=)\S', | 372 r'\s(\+=|-=|!=|<>|<=|>=|<<=|>>=|%=)\S', |
373 "missing whitespace around operator", | 373 "missing whitespace around operator", |
374 ), | 374 ), |
375 (r'[^^+=*/!<>&| %-](\s=|=\s)[^= ]', "wrong whitespace around ="), | 375 (r'[^^+=*/!<>&| %-:](\s=|=\s)[^= ]', "wrong whitespace around ="), |
376 ( | 376 ( |
377 r'raise [^,(]+, (\([^\)]+\)|[^,\(\)]+)$', | 377 r'raise [^,(]+, (\([^\)]+\)|[^,\(\)]+)$', |
378 "don't use old-style two-argument raise, use Exception(message)", | 378 "don't use old-style two-argument raise, use Exception(message)", |
379 ), | 379 ), |
380 (r' is\s+(not\s+)?["\'0-9-]', "object comparison with literal"), | 380 (r' is\s+(not\s+)?["\'0-9-]', "object comparison with literal"), |