mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
tidy: Add a rule ensuring that //
comments are followed by a space in Rust (#38698)
This shows up sometimes in code reviews, so it makes sense that tidy enforces it. `rustfmt` supports this via comment normalization, but it does many other things and is still an unstable feature (with bugs). Testing: There are new tidy tests for this change. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
8ca00a3b0c
commit
8743a11ba4
68 changed files with 169 additions and 152 deletions
|
@ -2,6 +2,10 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
//! This is a module, but this comment shouldn't trigger an error.
|
||||
//* This is also a module doc comment *//
|
||||
//This comment should trigger an error, because of missing space.
|
||||
|
||||
use app_units::Au;
|
||||
use raqote::{GradientStop, Source, SolidSource};
|
||||
use raqote::{Source, SolidSource},
|
||||
|
@ -78,4 +82,11 @@ impl test {
|
|||
} else {
|
||||
let xif = 42 in { xif } // Should not trigger
|
||||
}
|
||||
|
||||
//Comment with no space following it, should trigger an error.
|
||||
let a = 3;//This should cause a problem.
|
||||
//~^ This is a compile-test comment and shouldn't cause a problem.
|
||||
// This comment has a URL, but it shouldn't trigger an error http://servo.org.
|
||||
// This comment has a URL, but it shouldn't trigger an error http://servo.org.
|
||||
/* This is another style of comment, but shouldn't trigger an error. */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue