mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Test for missing newlines at end of file in tidy.py.
This commit is contained in:
parent
b1493519c9
commit
4ff4b5833d
4 changed files with 6 additions and 3 deletions
|
@ -139,4 +139,4 @@ impl FromStr for ByteString {
|
||||||
fn from_str(s: &str) -> Option<ByteString> {
|
fn from_str(s: &str) -> Option<ByteString> {
|
||||||
Some(ByteString::new(s.container_into_owned_bytes()))
|
Some(ByteString::new(s.container_into_owned_bytes()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,4 +50,4 @@ impl Reflectable for File {
|
||||||
fn reflector<'a>(&'a self) -> &'a Reflector {
|
fn reflector<'a>(&'a self) -> &'a Reflector {
|
||||||
self.blob.reflector()
|
self.blob.reflector()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,4 +151,4 @@ impl URLSearchParamsHelpers for URLSearchParams {
|
||||||
// XXXManishearth Implement this when the URL interface is implemented
|
// XXXManishearth Implement this when the URL interface is implemented
|
||||||
// http://url.spec.whatwg.org/#concept-uq-update
|
// http://url.spec.whatwg.org/#concept-uq-update
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,9 @@ def do_whitespace_check(name, contents):
|
||||||
for idx, line in enumerate(contents):
|
for idx, line in enumerate(contents):
|
||||||
if line[-1] == "\n":
|
if line[-1] == "\n":
|
||||||
line = line[:-1]
|
line = line[:-1]
|
||||||
|
else:
|
||||||
|
report_error_name_no(name, idx + 1, "No newline at EOF")
|
||||||
|
|
||||||
if line.endswith(' '):
|
if line.endswith(' '):
|
||||||
report_error_name_no(name, idx + 1, "trailing whitespace")
|
report_error_name_no(name, idx + 1, "trailing whitespace")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue