# HG changeset patch # User Augie Fackler # Date 2017-07-07 19:11:11 # Node ID d36bcba91845b88aedbcc8ec7415dab500d56c63 # Parent ffb30661f67288ac0797a899f753ffdda5738d98 check-code: prohibit `if False` antipattern Differential Revision: https://phab.mercurial-scm.org/D20 diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -301,6 +301,7 @@ pypats = [ "comparison with singleton, use 'is' or 'is not' instead"), (r'^\s*(while|if) [01]:', "use True/False for constant Boolean expression"), + (r'^\s*if False(:| +and)', 'Remove code instead of using `if False`'), (r'(?:(?