Skip to content
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

Python PEP8 max line length #65

Open
pordyna opened this issue Mar 15, 2023 · 6 comments
Open

Python PEP8 max line length #65

pordyna opened this issue Mar 15, 2023 · 6 comments

Comments

@pordyna
Copy link
Member

pordyna commented Mar 15, 2023

The PEP8 formatting standard that we are enforcing for our python code limits the code lines to max 79 characters, doc-strings and comments are restricted to 72. Together with the indentation and alignment rules in PEP8 this makes the code hard to format and read. For our C++ code, we decided on the 120 characters limit. I suggest we relax the rules for python too. Even the PEP8 says:

For code maintained exclusively or primarily by a team that can reach agreement on this issue, it is okay to increase the line length limit up to 99 characters, provided that comments and docstrings are still wrapped at 72 characters.

Please, comment your opinion on this. I will suggest we vote first if we increase the numbers at all. If you vote to increase one of the limits, please, include a suggestion for a new limit in your comment.
Vote:

Question Yes No
Increase limit for code lines 1 0
Increase limit for comments and doc-strings 1 0
@psychocoderHPC
Copy link
Member

Question Yes No
Increase limit for code lines 2 0
Increase limit for comments and doc-strings 2 0

@BrianMarre
Copy link
Member

BrianMarre commented Mar 15, 2023

Question Yes No
Increase limit for code lines 3 0
Increase limit for comments and doc-strings 3 0

120 for both limits seems reasonable

@wmles
Copy link

wmles commented Mar 16, 2023

in my experience it doesn't make the code less readable with short lines (there is always a natural point to wrap), but rather better git-diff-able. Comments on the other hand are not nice to write with 60 characters or so. Probably there is a reason why the official proposal suggests it the other way around^^
Well, anyway, 120 characters is probably fine, too. Since certainly no one will use picongpu scripts to import them from another project and build automatic documentation, the argument "if a team can reach agreement" overrides all.

@HighIander
Copy link
Member

HighIander commented Mar 16, 2023

Question Yes No
Increase limit for code lines 4 0
Increase limit for comments and doc-strings 4 0

I'm fine even with infinitely long lines, too (my editor can wrap lines if I need it).

@bernhardmgruber
Copy link
Collaborator

in my experience it doesn't make the code less readable with short lines, but rather better git-diff-able.

Which is why we picked 120 LOCs for C++, since then you can fit a 3-window diff nicely on a 1440p monitor. @SimeonEhrig and me verified that :)

@SimeonEhrig
Copy link
Contributor

Question Yes No
Increase limit for code lines 5 0
Increase limit for comments and doc-strings 5 0

Which is why we picked 120 LOCs for C++, since then you can fit a 3-window diff nicely on a 1440p monitor. @SimeonEhrig and me verified that :)

That's correct, but I also recognized that 120 LOC is to much for 2 windows side by side on my FHD Displays (mainly on the laptop). 100 LOC would be fine. But I get new WQHD displays 🤔
So increasing yes, 100 LOC is no problem, 120 is possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants