servo: Merge #11329 - Report use statements that use {} with only one entry (from c-rhodes:11320); r=jdm

Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data:
- [X ] `./mach build -d` does not report any errors
- [X ] `./mach test-tidy --faster` does not report any errors
- [X ] These changes fix #11320  (github issue number if applicable).

Either:
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process.

Source-Repo: https://github.com/servo/servo
Source-Revision: 2f9796fa696e9514280777398467696dd4f004b3
This commit is contained in:
Cullen Rhodes
2016-05-27 07:11:17 -05:00
parent 33a1351325
commit 44dc9f68ea
55 changed files with 92 additions and 89 deletions

View File

@@ -390,6 +390,8 @@ def check_rust(file_name, lines):
# No benefit over using &str
(r": &String", "use &str instead of &String", no_filter),
(r"^&&", "operators should go at the end of the first line", no_filter),
(r"\{[A-Za-z0-9_]+\};", "use statement contains braces for single import",
lambda match, line: line.startswith('use ')),
]
for pattern, message, filter_func in regex_rules: