servo: Merge #7362 - Forbid multiline imports (from wilcus:ForbidMultilineImports); r=jdm
https://github.com/servo/servo/issues/7356 Source-Repo: https://github.com/servo/servo Source-Revision: 121110a52a549b44e65aa4ba0669bd75702588ea
This commit is contained in:
@@ -246,8 +246,7 @@ def check_rust(file_name, contents):
|
||||
# imports must be in the same line and alphabetically sorted
|
||||
if line.startswith("use "):
|
||||
use = line[4:]
|
||||
match = use.find('{')
|
||||
if match >= 0 and "}" not in use[match:]:
|
||||
if not use.endswith(";"):
|
||||
yield (idx + 1, "use statement spans multiple lines")
|
||||
uses.append(use[:len(use) - 1])
|
||||
elif len(uses) > 0:
|
||||
|
||||
Reference in New Issue
Block a user