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
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue