Replies: 3 comments
-
I have made PR #500 as an example of how auto-formatted code by |
Beta Was this translation helpful? Give feedback.
-
Thank you @ajshajib! Yes, 88 makes sense and the auto-formatting looks ok (and does also a lot of the subtle things good for sphinx/readthedocs (I hope) |
Beta Was this translation helpful? Give feedback.
-
The line-length limit has been set to 88 characters by #508. All the code has been formatted to follow this by #504. |
Beta Was this translation helpful? Give feedback.
-
Continuing the discussion with @sibirrer from #496.
The current style guideline allows 120 characters for the maximum line length. For context, PEP8 suggests 79 (which is a bit old-fashioned because I think that was with emacs-type editors in mind). More modern styles like the
black
auto-formatter choose 88 as the default.The main argument for a shorter line-length limit than 120 would be ease of readability and working with the usual IDE view on our monitors. This is how it looks if I want to have a split screen on PyCharm to look at the main code and its test file while working. You can see the lines overflowing on both screens needing me to scroll sideways, thus adding a barrier to a smooth workflow. The vertical grey lines right before the right edges show the 88-character mark. So, this default 88-character chosen by the
black
auto-formatter makes sense, given the modern screen sizes and resolutions. For example, this screenshot is on my MacBook Pro (screen size with 1768p horizontal resolution and 12-point font size.I suggest choosing 88 as the character limit unless the line-breaking would make the lines look too odd. If this style is chosen, the existing codes could be easily formatted to the new limit using
black
. But we can discuss the pros and cons.Beta Was this translation helpful? Give feedback.
All reactions