Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes three kinds of style fixes/changes, of which the first two are the most valuable but the third is the only one that really requires explanation.
A number of f-strings performed no string interpolation. This changes them to be regular string literals.
One of the docstrings had a very wide doctest. This was code originally in a
main()
function that became unwrapped when converted to a docstest. (Originally it was wrappedblack
-style.) This rewraps it as it had been, using the "..." statement continuation syntax for doctests.In
original_codebase/
, I wrapped docstrings to 88 columns (theblack
default, whichblack
does not enforce in docstrings, but which the new docstrings are consistent with). I think it makes sense to do this, because it is in line with the kind of stylistic changes to the original codebase that were done recently in bf86554 (part of V0.0.1 packaging #30).To do that, I kept everything under 89 columns unchanged, even when wrapping other parts of the same docstring. I wrapped overly long parts to 79 columns, which seemed to look better than wrapping to 88. I maintained the existing style of using hanging indents to continue descriptions of individual function parameters. In one case I departed from this, instead removing some extra words from parameter descriptions ("if you want to" became "to").
The changes to the original codebase are the least important, because that is not actively developed. If those changes are not considered worthwhile, I'd be pleased to remove them from this PR. One of my motivations in including them is that if we add more automatic style checking in the future, docstrings in the original codebase will no longer prevent it from being used on the entire repository if desired (as
black
andisort
are being used).