mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Test for trailing spaces in tidy.py.
This commit is contained in:
parent
695fe12863
commit
b1493519c9
5 changed files with 15 additions and 5 deletions
|
@ -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 {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ pub struct Opts {
|
|||
/// cause it to produce output on that interval (`-p`).
|
||||
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`).
|
||||
pub memory_profiler_period: Option<f64>,
|
||||
|
||||
|
|
|
@ -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/<path to git checkout>/servo/src/etc')
|
||||
#import servo_gdb
|
||||
#servo_gdb.register_printers(None)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue