diff options
author | PythonNut <PythonNut@users.noreply.github.com> | 2016-01-11 01:20:46 +0000 |
---|---|---|
committer | PythonNut <PythonNut@users.noreply.github.com> | 2016-01-11 01:32:24 +0000 |
commit | 3dfa89540aa4b25e21f5c301215067b1ee5053b4 (patch) | |
tree | 97c874536d14dadbe868ee0cbf21482ce0da71f2 /python/tidy.py | |
parent | 4d8d6bf7ff286a0257a3f42ea514f305670b6c15 (diff) | |
download | servo-3dfa89540aa4b25e21f5c301215067b1ee5053b4.tar.gz servo-3dfa89540aa4b25e21f5c301215067b1ee5053b4.zip |
Fix literal braces in string formatting in tidy.py, fixes #9151
Diffstat (limited to 'python/tidy.py')
-rw-r--r-- | python/tidy.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/tidy.py b/python/tidy.py index d3877fe9e56..0b7c96c9896 100644 --- a/python/tidy.py +++ b/python/tidy.py @@ -315,12 +315,12 @@ def check_rust(file_name, lines): # ignore "crate::mod" and ignore flagging macros like "$t1:expr" (r"[^:]:[A-Za-z]", "missing space after :", lambda match, line: '$' not in line[:match.end()]), - (r"[A-Za-z0-9\)]{", "missing space before {", no_filter), + (r"[A-Za-z0-9\)]{", "missing space before {{", no_filter), # ignore cases like "{}", "}`", "}}" and "use::std::{Foo, Bar}" - (r"[^\s{}]}[^`]", "missing space before }", + (r"[^\s{}]}[^`]", "missing space before }}", lambda match, line: not re.match(r'^(pub )?use', line)), # ignore cases like "{}", "`{", "{{" and "use::std::{Foo, Bar}" - (r"[^`]{[^\s{}]", "missing space after {", + (r"[^`]{[^\s{}]", "missing space after {{", lambda match, line: not re.match(r'^(pub )?use', line)), # There should not be any extra pointer dereferencing (r": &Vec<", "use &[T] instead of &Vec<T>", no_filter), @@ -475,7 +475,7 @@ def check_spec(file_name, lines): # Pattern representing a line with comment comment_patt = re.compile("^\s*///?.+$") - pattern = "impl %sMethods for %s {" % (file_name, file_name) + pattern = "impl {}Methods for {} {{".format(file_name, file_name) brace_count = 0 in_impl = False for idx, line in enumerate(lines): |