diff options
author | aeischeid <a.eischeid@gmail.com> | 2016-05-11 16:19:17 -0500 |
---|---|---|
committer | aeischeid <a.eischeid@gmail.com> | 2016-05-11 16:19:17 -0500 |
commit | fa4665e2a74dc324f3e03cd8342e9abb151133c2 (patch) | |
tree | ead8ba1171120c5708c78b0f85c0a95a1d73022a /python/tidy/servo_tidy | |
parent | a85db48623d8f5b5dbddbcc1f1ba0eaa0b531249 (diff) | |
download | servo-fa4665e2a74dc324f3e03cd8342e9abb151133c2.tar.gz servo-fa4665e2a74dc324f3e03cd8342e9abb151133c2.zip |
add tidy test for 'missing space after :' in stucts
Diffstat (limited to 'python/tidy/servo_tidy')
-rw-r--r-- | python/tidy/servo_tidy/tidy.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py index eb3aa579b66..a5fda1fedd4 100644 --- a/python/tidy/servo_tidy/tidy.py +++ b/python/tidy/servo_tidy/tidy.py @@ -336,7 +336,8 @@ def check_rust(file_name, lines): # get rid of strings and chars because cases like regex expression, keep attributes if not line_is_attribute(line): - line = re.sub(r'"(\\.|[^\\"])*?"|' + r"'(\\.|[^\\'])*?'", '', line) + line = re.sub(r'"(\\.|[^\\"])*?"', '""', line) + line = re.sub(r"'(\\.|[^\\'])*?'", "''", line) # get rid of comments line = re.sub('//.*?$|/\*.*?$|^\*.*?$', '', line) @@ -373,7 +374,7 @@ def check_rust(file_name, lines): (r" :[^:]", "extra space before :", lambda match, line: 'trait ' not in line[:match.start()]), # ignore "crate::mod" and ignore flagging macros like "$t1:expr" - (r"[^:]:[A-Za-z]", "missing space after :", + (r"[^:]:[A-Za-z0-9\"]", "missing space after :", lambda match, line: '$' not in line[:match.end()]), (r"[A-Za-z0-9\)]{", "missing space before {{", no_filter), # ignore cases like "{}", "}`", "}}" and "use::std::{Foo, Bar}" |