-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Make make tidy
Python scripts more idiomatic
#21539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
|
||
with open(path, 'r') as f: | ||
for line_num, line in enumerate(f, start=1): | ||
p = re.compile("(E\d\d\d\d)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move the regex compile out of the for loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point; changing this now.
make tidy
scriptsmake tidy
Python scripts more idiomatic
# except according to those terms. | ||
""" | ||
license_re = re.compile( | ||
u"""(#|//) Copyright .* The Rust Project Developers. See the COPYRIGHT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be a raw string literal (i.e., ur"""…"""
), so all the doubled backslashes can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented it this way initially, but Python 3 didn't like it.
Also makes errorck.py and tidy.py compatible with Python 3.
@bors: rollup |
Also makes `errorck.py` and `tidy.py` compatible with Python 3.
Also makes `errorck.py` and `tidy.py` compatible with Python 3.
Also makes
errorck.py
andtidy.py
compatible with Python 3.