diff --git a/src/components/gfx/font_template.rs b/src/components/gfx/font_template.rs index 2bd6a1270d2..12753da68a1 100644 --- a/src/components/gfx/font_template.rs +++ b/src/components/gfx/font_template.rs @@ -37,7 +37,7 @@ impl PartialEq for FontTemplateDescriptor { } /// 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. pub struct FontTemplate { identifier: String, @@ -112,4 +112,4 @@ impl FontTemplate { } } } -} \ No newline at end of file +} diff --git a/src/components/script/dom/htmlpreelement.rs b/src/components/script/dom/htmlpreelement.rs index fa0e0a612b0..41b518271b5 100644 --- a/src/components/script/dom/htmlpreelement.rs +++ b/src/components/script/dom/htmlpreelement.rs @@ -20,7 +20,7 @@ pub struct HTMLPreElement { impl HTMLPreElementDerived for EventTarget { fn is_htmlpreelement(&self) -> bool { - self.type_id == NodeTargetTypeId(ElementNodeTypeId(HTMLPreElementTypeId)) + self.type_id == NodeTargetTypeId(ElementNodeTypeId(HTMLPreElementTypeId)) } } diff --git a/src/components/util/opts.rs b/src/components/util/opts.rs index 0fa3a79ed7c..bdd1d2d4347 100644 --- a/src/components/util/opts.rs +++ b/src/components/util/opts.rs @@ -45,7 +45,7 @@ pub struct Opts { /// cause it to produce output on that interval (`-p`). pub time_profiler_period: Option, - /// `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`). pub memory_profiler_period: Option, diff --git a/src/etc/servo_gdb.py b/src/etc/servo_gdb.py index 188f317fb70..fab29f3cfe6 100644 --- a/src/etc/servo_gdb.py +++ b/src/etc/servo_gdb.py @@ -12,7 +12,7 @@ # To load these, you need to add something like the following # to your .gdbinit file. #python -#import sys +#import sys #sys.path.insert(0, '/home//servo/src/etc') #import servo_gdb #servo_gdb.register_printers(None) diff --git a/src/etc/tidy.py b/src/etc/tidy.py index ee7aab52f2e..c0cdb1eb433 100644 --- a/src/etc/tidy.py +++ b/src/etc/tidy.py @@ -27,6 +27,14 @@ def do_license_check(name, contents): 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 = [ # Upstream "src/support", @@ -36,6 +44,7 @@ exceptions = [ # Generated and upstream code combined with our own. Could use cleanup "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: lines = fp.readlines() do_license_check(path, "".join(lines)) + do_whitespace_check(path, lines) sys.exit(err)