Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upIssue #9042: Report incorrect number of spaces around => in the style checker #9055
Conversation
highfive
commented
Dec 23, 2015
|
This looks nice. Only one nit :) Reviewed 7 of 7 files at r1. python/tidy.py, line 317 [r1] (raw file): Comments from the review on Reviewable.io |
|
python/tidy.py, line 317 [r1] (raw file): Comments from the review on Reviewable.io |
|
Thanks for the review. I've replaced the first test by a call to find, but I've kept the rest as regexp matching for readability (catching all kinds of whitespaces won't be very readable). I also check for whitespace before => because patterns like "Err(_)=>" are not caught Comments from the review on Reviewable.io |
|
Review status: 6 of 7 files reviewed at latest revision, 2 unresolved discussions. python/tidy.py, line 317 [r2] (raw file): match_idx = line.find('=>')
if match != -1:
if line[match_idx - 1] != ' ':
# missing space ...
elif line[match_idx + 2] != ' ':
# missing space ...
elif line[match_idx + 3] == ' ':
# extra space ...This also avoids multiple searches, right? Comments from the review on Reviewable.io |
|
python/tidy.py, line 317 [r2] (raw file): Comments from the review on Reviewable.io |
|
Review status: 6 of 7 files reviewed at latest revision, 2 unresolved discussions. python/tidy.py, line 317 [r2] (raw file): match_idx = line.find('=>')
if match != -1:
if line[match_idx - 1] != ' ':
# missing space ...
elif line[match_idx + 2] != ' ':
if line[match_idx + 2] != '\n'
# missing space ...
elif line[match_idx + 3] == ' ':
# extra space ...I'm sorry that I'm being nitpicky here. The reason I'm obsessed about Well, I agree that there are plenty of regex searches in tidy already. I'm planning to refactor it someday soon. That said, I'll leave this decision to someone else (I'm probably biased about this :P) Comments from the review on Reviewable.io |
|
python/tidy.py, line 317 [r2] (raw file): Comments from the review on Reviewable.io |
|
I believe elif line[match_idx + 2] != ' ':
if line[match_idx + 2] != '\n'could also be written as: elif line[match_idx + 2] not in [' ', '\n']:edit: ignore this, since the code in question isn't even present in the PR. |
|
@bors-servo: delegate=Wafflespeanut |
|
@jdm Yeah, that works. I'm pretty sure I thought of that back then, but I now forget why I chose not to use it. (sigh) |
|
Review status: 6 of 7 files reviewed at latest revision, 3 unresolved discussions. python/tidy.py, line 319 [r3] (raw file): python/tidy.py, line 321 [r3] (raw file): python/tidy.py, line 323 [r3] (raw file): Comments from the review on Reviewable.io |
|
python/tidy.py, line 319 [r3] (raw file): Comments from the review on Reviewable.io |
|
python/tidy.py, line 321 [r3] (raw file): Comments from the review on Reviewable.io |
… checker.
|
The PR looks great! Reviewed 1 of 1 files at r3, 1 of 1 files at r4. python/tidy.py, line 319 [r3] (raw file): Comments from the review on Reviewable.io |
|
@bors-servo r+ Thanks! |
|
(sigh) |
|
@bors-servo r=Wafflespeanut |
1 similar comment
|
@bors-servo r=Wafflespeanut |
|
|
Issue #9042: Report incorrect number of spaces around => in the style checker Fixes #9042 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9055) <!-- Reviewable:end -->
|
|
|
|
@bors-servo retry |
|
|
|
|
simartin commentedDec 23, 2015
Fixes #9042