servo: Merge #7475 - Make test-tidy check that braces have spaces before or after them (from wilcus:checkBracesSpaces); r=jdm
https://github.com/servo/servo/issues/7413 Posible future/past bug fixed in components/script/timers.rs Source-Repo: https://github.com/servo/servo Source-Revision: 60c72f601c4dd7cfbc8a4a983099a4b323f1516a
This commit is contained in:
@@ -243,6 +243,16 @@ def check_rust(file_name, contents):
|
||||
if match:
|
||||
yield (idx + 1, "missing space before {")
|
||||
|
||||
# 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)
|
||||
if match and not (line.startswith("use") or line.startswith("pub use")):
|
||||
yield (idx + 1, "missing space after {")
|
||||
|
||||
# imports must be in the same line and alphabetically sorted
|
||||
if line.startswith("use "):
|
||||
use = line[4:]
|
||||
|
||||
Reference in New Issue
Block a user