Test for trailing spaces in tidy.py.

This commit is contained in:
Ms2ger 2014-07-11 13:14:12 +02:00
parent 695fe12863
commit b1493519c9
5 changed files with 15 additions and 5 deletions

View file

@ -37,7 +37,7 @@ impl PartialEq for FontTemplateDescriptor {
} }
/// This describes all the information needed to create /// This describes all the information needed to create
/// font instance handles. It contains a unique /// font instance handles. It contains a unique
/// FontTemplateData structure that is platform specific. /// FontTemplateData structure that is platform specific.
pub struct FontTemplate { pub struct FontTemplate {
identifier: String, identifier: String,
@ -112,4 +112,4 @@ impl FontTemplate {
} }
} }
} }
} }

View file

@ -20,7 +20,7 @@ pub struct HTMLPreElement {
impl HTMLPreElementDerived for EventTarget { impl HTMLPreElementDerived for EventTarget {
fn is_htmlpreelement(&self) -> bool { fn is_htmlpreelement(&self) -> bool {
self.type_id == NodeTargetTypeId(ElementNodeTypeId(HTMLPreElementTypeId)) self.type_id == NodeTargetTypeId(ElementNodeTypeId(HTMLPreElementTypeId))
} }
} }

View file

@ -45,7 +45,7 @@ pub struct Opts {
/// cause it to produce output on that interval (`-p`). /// cause it to produce output on that interval (`-p`).
pub time_profiler_period: Option<f64>, pub time_profiler_period: Option<f64>,
/// `None` to disable the memory profiler or `Some` with an interval in seconds to enable it /// `None` to disable the memory profiler or `Some` with an interval in seconds to enable it
/// and cause it to produce output on that interval (`-m`). /// and cause it to produce output on that interval (`-m`).
pub memory_profiler_period: Option<f64>, pub memory_profiler_period: Option<f64>,

View file

@ -12,7 +12,7 @@
# To load these, you need to add something like the following # To load these, you need to add something like the following
# to your .gdbinit file. # to your .gdbinit file.
#python #python
#import sys #import sys
#sys.path.insert(0, '/home/<path to git checkout>/servo/src/etc') #sys.path.insert(0, '/home/<path to git checkout>/servo/src/etc')
#import servo_gdb #import servo_gdb
#servo_gdb.register_printers(None) #servo_gdb.register_printers(None)

View file

@ -27,6 +27,14 @@ def do_license_check(name, contents):
report_error_name_no(name, 1, "incorrect license") report_error_name_no(name, 1, "incorrect license")
def do_whitespace_check(name, contents):
for idx, line in enumerate(contents):
if line[-1] == "\n":
line = line[:-1]
if line.endswith(' '):
report_error_name_no(name, idx + 1, "trailing whitespace")
exceptions = [ exceptions = [
# Upstream # Upstream
"src/support", "src/support",
@ -36,6 +44,7 @@ exceptions = [
# Generated and upstream code combined with our own. Could use cleanup # Generated and upstream code combined with our own. Could use cleanup
"src/components/script/dom/bindings/codegen", "src/components/script/dom/bindings/codegen",
"src/components/style/properties/mod.rs",
] ]
@ -66,5 +75,6 @@ for path in file_names:
with open(path, "r") as fp: with open(path, "r") as fp:
lines = fp.readlines() lines = fp.readlines()
do_license_check(path, "".join(lines)) do_license_check(path, "".join(lines))
do_whitespace_check(path, lines)
sys.exit(err) sys.exit(err)