From bd363b009db8e5e233cd862aef5c8d497495a10e Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Thu, 8 Oct 2015 02:22:27 +0200 Subject: [PATCH] Make test-tidy ignore braces surrounded by backticks --- python/tidy.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/tidy.py b/python/tidy.py index 0fac94240c7..b0c61dba333 100644 --- a/python/tidy.py +++ b/python/tidy.py @@ -305,13 +305,13 @@ def check_rust(file_name, contents): if match: yield (idx + 1, "missing space before {") - # ignored cases like {} and }} - match = re.search(r"[^\s{}]}", line) + # ignored cases like {}, }` and }} + match = re.search(r"[^\s{}]}[^`]", line) if match and not (line.startswith("use") or line.startswith("pub use")): yield (idx + 1, "missing space before }") - # ignored cases like {} and {{ - match = re.search(r"{[^\s{}]", line) + # ignored cases like {}, `{ and {{ + match = re.search(r"[^`]{[^\s{}]", line) if match and not (line.startswith("use") or line.startswith("pub use")): yield (idx + 1, "missing space after {")