mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Auto merge of #7475 - wilmoz:checkBracesSpaces, r=jdm
Make test-tidy check that braces have spaces before or after them https://github.com/servo/servo/issues/7413 Posible future/past bug fixed in components/script/timers.rs <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7475) <!-- Reviewable:end -->
This commit is contained in:
commit
60c72f601c
10 changed files with 31 additions and 21 deletions
|
@ -183,7 +183,7 @@ impl TimerManager {
|
|||
if is_interval == IsInterval::NonInterval {
|
||||
break;
|
||||
}
|
||||
} else if id == control_handle.id() {;
|
||||
} else if id == control_handle.id() {
|
||||
match control_port.recv().unwrap() {
|
||||
TimerControlMsg::Suspend => {
|
||||
let msg = control_port.recv().unwrap();
|
||||
|
|
|
@ -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:]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue