Formatting: Format with Black, increase max line length to 100, combine multi-line blocks #178
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 PR does 3 thing, each in a separate commit:
black
)black --line-limit 100
)black --line-limit 100 -C
)In each commit some edge cases were by hand removed to retain the best readability. The code now fully follows Black formatting.
The 100 character line limit was chosen because it increases readability by offering more code in a single view and allows for slightly longer (and thus more descriptive) variable names without expanding code to multiple lines.
The trailing comma handling by Black is is worth explaining a little. If Black detects a trailing comma, such as
it won't format the code to a single line. But if it doesn't detect a trailing comma, it does. So
becomes
This way you can control if you would like your code to stay in multi-line or be reduced to a single line.
@quaquel Could you let me know if you A) agree with the increased line limit of 100 characters and B) find that this improved readability generally? (I checked everything by hand but just for sure)
(please let me merge if everything is ok)