Make test-tidy ignore braces surrounded by backticks

This commit is contained in:
Anthony Ramine 2015-10-08 02:22:27 +02:00
parent c77d3b965f
commit bd363b009d

View file

@ -305,13 +305,13 @@ def check_rust(file_name, contents):
if match: if match:
yield (idx + 1, "missing space before {") yield (idx + 1, "missing space before {")
# ignored cases like {} and }} # ignored cases like {}, }` and }}
match = re.search(r"[^\s{}]}", line) match = re.search(r"[^\s{}]}[^`]", line)
if match and not (line.startswith("use") or line.startswith("pub use")): if match and not (line.startswith("use") or line.startswith("pub use")):
yield (idx + 1, "missing space before }") yield (idx + 1, "missing space before }")
# ignored cases like {} and {{ # ignored cases like {}, `{ and {{
match = re.search(r"{[^\s{}]", line) match = re.search(r"[^`]{[^\s{}]", line)
if match and not (line.startswith("use") or line.startswith("pub use")): if match and not (line.startswith("use") or line.startswith("pub use")):
yield (idx + 1, "missing space after {") yield (idx + 1, "missing space after {")