-
Notifications
You must be signed in to change notification settings - Fork 26
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
Use and apply black formatting #860
base: dev
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## dev #860 +/- ##
=======================================
Coverage 88.19% 88.20%
=======================================
Files 44 44
Lines 9022 9029 +7
Branches 2577 2577
=======================================
+ Hits 7957 7964 +7
Misses 753 753
Partials 312 312
☔ View full report in Codecov by Sentry. |
That sounds good to me too |
for more information, see https://pre-commit.ci
@rly are we good to merge this? |
Motivation
I added
black
to pre-commit so it will automatically modify the code to comply with black's uncompromising style guide.In this PR, I made some manual adjustments, particularly to docval statements so that the arguments they are consistent. Note that this code:
@docval({"name": "key_name", "type": str, "doc": "The name of the key to be added."})
is kept as is by
black
. If we want to change that to:then we need to add a comma at the end of the last element in the dictionary.
For us, I think we should keep the dict arguments within a single docval call consistent with each other. If all the dicts can fit on one line, then they should all be on one line. Otherwise, expand all the dicts to the second form above, which makes the arguments more readable in my opinon, because it is easier to see the parallelism of the arguments.
See also #844.
How to test the behavior?
Checklist
flake8
from the source directory.