From 8da2eb58ec3496167e6f6e68175461c95c4b89b3 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 8 Sep 2022 23:58:17 -0700 Subject: [PATCH] =?UTF-8?q?template=5Fparser:=20Spell=20=E2=80=9CHandlebar?= =?UTF-8?q?s=E2=80=9D=20correctly.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Anders Kaseorg --- tools/check-templates | 6 +++--- tools/lib/pretty_print.py | 2 +- tools/lib/template_parser.py | 20 ++++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tools/check-templates b/tools/check-templates index 68a0ec7e67..41c3633242 100755 --- a/tools/check-templates +++ b/tools/check-templates @@ -42,7 +42,7 @@ def check_our_files(modified_only: bool, all_dups: bool, fix: bool, targets: Lis exclude=EXCLUDED_FILES, ) - check_handlebar_templates(by_lang["hbs"], fix) + check_handlebars_templates(by_lang["hbs"], fix) check_html_templates(by_lang["html"], all_dups, fix) @@ -108,8 +108,8 @@ def check_html_templates(templates: Iterable[str], all_dups: bool, fix: bool) -> sys.exit(1) -def check_handlebar_templates(templates: Iterable[str], fix: bool) -> None: - # Check all our handlebars templates. +def check_handlebars_templates(templates: Iterable[str], fix: bool) -> None: + # Check all our Handlebars templates. templates = [fn for fn in templates if fn.endswith(".hbs")] for fn in templates: diff --git a/tools/lib/pretty_print.py b/tools/lib/pretty_print.py index 1691248cb6..3166ccc443 100644 --- a/tools/lib/pretty_print.py +++ b/tools/lib/pretty_print.py @@ -111,7 +111,7 @@ def fix_indents_for_multi_line_tags(tokens: List[Token]) -> None: if token.line_span == 1 or token.indent is None: continue - if token.kind in ("django_comment", "handlebar_comment", "html_comment", "text"): + if token.kind in ("django_comment", "handlebars_comment", "html_comment", "text"): continue_indent = token.indent else: continue_indent = token.indent + " " diff --git a/tools/lib/template_parser.py b/tools/lib/template_parser.py index 76655aa33b..1bd78e48a8 100644 --- a/tools/lib/template_parser.py +++ b/tools/lib/template_parser.py @@ -66,13 +66,13 @@ def tokenize(text: str) -> List[Token]: def looking_at_htmlcomment() -> bool: return looking_at("