diff --git a/tools/check-templates b/tools/check-templates index 9369d22b28..ef9dd32dfd 100755 --- a/tools/check-templates +++ b/tools/check-templates @@ -17,13 +17,16 @@ except ImportError as e: sys.exit(1) class Record(object): - pass + def __init__(self, func): + self.depth = 0 + self.i = 0 + self.line = 1 + self.col = 1 + self.matcher = func def validate(fn, check_indent=True): text = open(fn).read() - state = Record() - def NoStartTag(end_tag): raise Exception(''' No start tag @@ -60,11 +63,7 @@ def validate(fn, check_indent=True): state.depth -= 1 state.matcher = f - state.depth = 0 - state.i = 0 - state.line = 1 - state.col = 1 - state.matcher = NoStartTag + state = Record(NoStartTag) def advance(n): for _ in range(n): diff --git a/tools/run-mypy b/tools/run-mypy index 754c7de5df..31c26a1b49 100755 --- a/tools/run-mypy +++ b/tools/run-mypy @@ -59,7 +59,6 @@ api/integrations/twitter/twitter-search-bot bots/check-mirroring bots/gcal-bot bots/githook-post-receive -tools/check-templates tools/compile-handlebars-templates tools/deprecated/inject-messages/inject-messages tools/deprecated/review