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
Add blacken-docs
to pre-commit
& apply minor reST fixes
#1807
Conversation
...since this is something that will very likely be determined by the autoformatters.
...because there are a few lines that are intended to show bad coding practices that should not be formatted by blacken-docs. Also, there isn't a way to exclude a code block at present.
Thank you for contributing to PlasmaPy! The project's future depends deeply on contributors like you, so we deeply appreciate it! 🌱 The following checklist will be used by the code reviewer to help guide the code review process.
|
A comprehension might be more readable when spread out over multiple | ||
lines. | ||
|
||
.. code-block:: pycon | ||
|
||
>>> { | ||
... x: x ** 2 | ||
... for x in range(17) | ||
... if x % 2 == 0 | ||
... } | ||
{0: 0, 2: 4, 4: 16, 6: 36, 8: 64, 10: 100, 12: 144, 14: 196, 16: 256} | ||
|
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 isn't relevant to us anymore since this sort of formatting is handed by autoformatters. Hence, we can delete it!
Codecov ReportBase: 98.34% // Head: 98.34% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #1807 +/- ##
=======================================
Coverage 98.34% 98.34%
=======================================
Files 91 91
Lines 8223 8223
=======================================
Hits 8087 8087
Misses 136 136
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
blacken-docs
to pre-commit
& apply minor reST fixes
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.
Looks simple enough! Glad to have it, too.
Thanks for the quick review! I'm happy to have the extra check that...with running black in the docs...we can check to make sure that the Abstract Syntax Tree for examples is valid (i.e. that it's valid Python code). |
This PR adds a pre-commit hook for blacken-docs and applies a bunch of the changes. It also applies some issues with examples in code blocks that I found with shed, which I learned about in a podcast and was trying out for fun.