mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Forbid multiline imports
This commit is contained in:
parent
f79220f1a8
commit
63851f2650
2 changed files with 5 additions and 7 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue