Modernize prepare-dev.py
Review Request #10179 — Created Sept. 25, 2018 and submitted
Our prepare-dev.py was doing quite a few things that weren't best
practices:
- Global mutable state in the form of
options. - Using the deprecated
optparsemodule instead ofargparse. - No docstrings anywhere.
These issues have all been addressed. Where we were previously using
global mutable state we now pass our state as an argument to the
function that requires it (create_settings). Our argument parser has
been updated to use argparse.ArgumentParser. The module and all
functions now have docstrings that meet our documentation guidelines.
Additionally, I cleaned up control flow a bit in main() where things
were running in a try..except that didn't need to.
Ran
prepare-dev.pyand it ran correctly.
| Description | From | Last Updated |
|---|---|---|
|
E303 too many blank lines (2) |
|
|
|
It's kind of weird to have this be this late. I know we had a few people run into issues … |
|
|
|
typo: cmdling |
|
|
|
I think this can just be "Parse the command-line arguments". Creating an argument parser is just an implementation detail that … |
|
- Commit:
-
f178238ceb4f05e0f1d6c5eaf2c6f32c4c4d6520e1cc53e4b31ad4b5a8d5b60d1f9e6c641bf4b5ca
- Diff:
-
Revision 2 (+72 -46)
Checks run (2 succeeded)
- Change Summary:
-
Addressed feedback
- Commit:
-
e1cc53e4b31ad4b5a8d5b60d1f9e6c641bf4b5caf8ff97c7125fd19a4e1e96db9c1096e20911af81
- Diff:
-
Revision 3 (+74 -47)
Checks run (2 succeeded)
- Change Summary:
-
Addressed feedback
- Commit:
-
f8ff97c7125fd19a4e1e96db9c1096e20911af8162a2eef262a58f3c1da4d7f9dab463e2262d12e8
- Diff:
-
Revision 4 (+74 -47)