Repository navigation
Handle escaped strings in rust linting, tidy.py - #9889
bors-servo merged 1 commit into
Conversation
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @frewsxcv (or someone else) soon. |
|
You might be able to use a "raw" strings here. Some documentation: Look for the paragraph in that link starting with "When an 'r' or 'R' prefix is present,". As an example: >>> r"hello\\world" == "hello\\\\world"
True |
|
Great suggestion -- implemented |
|
Hrrmm... This makes a lot of tidy failures: https://travis-ci.org/servo/servo/jobs/114132659 |
|
I will look into it. My immediate guess is that this is due to the fact
|
|
Not my original thought, but thanks to the build I saw how to run tidy across the whole codebase, was able to repro and identify that my regex wasn't letting through any escapes except for escaped string terminators. |
| if not filter_func(match, line): | ||
| continue | ||
|
|
||
| print line |
There was a problem hiding this comment.
Oops...this will print every erroneous line. Debugging garbage made it into my branch. amended, force pushed, so that crap isn't even in history.
Thank you for catching that...
8041d2e to
e6d99ea
Compare
|
This looks good, sorry for the delay. Could you squash your commits? :) |
tidy.py now strips strings even if they have escapes before linting. Use raw strings for regex with lots of backslashes Handle ALL escape sequences in strings for tidy, not just escaped string terminators
e6d99ea to
9b91c7a
Compare
|
Squashed! |
|
@bors-servo: r=ecoal95 |
|
📌 Commit 9b91c7a has been approved by |
…string-contents, r=ecoal95 Handle escaped strings in rust linting, tidy.py A little annoying to read since we have to escape for python (\\) and then escape for re (\\\\) and then even at times escape for single quotes immediately after, (\\\\\), but tidy.py now strips strings even if they have escapes before linting. Fixes #9806 -- basically the problem is that the PR which first revealed this had an escape in one of its strings which included an = sign. The escape meant the string wasn't escaped before it looked for spaces around spaces. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9889) <!-- Reviewable:end -->
|
☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, status-appveyor |
A little annoying to read since we have to escape for python () and
then escape for re (\) and then even at times escape for single
quotes immediately after, (\), but tidy.py now strips strings even
if they have escapes before linting.
Fixes #9806 -- basically the problem is that the PR which first revealed this had an escape in one of its strings which included an = sign. The escape meant the string wasn't escaped before it looked for spaces around spaces.