mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-25 05:11:09 +08:00
Limit lines to 130 chracters (#2169)
Fixes #2124. As mentioned in the issue, the current guidelines lead to extremely long lines of many hundreds of characters, which make code hard to read and review. I think there should be some limit to line length, but it's OK for stubs to have somewhat longer lines than normal code. For reference, there are currently 115 lines in typeshed over 200 characters; 523 over 120 characters; and 2980 over 79 characters. We picked 130 because that's the longest line GitHub displays on a 13" laptop in a unified diff without folding. There are currently 382 lines in typeshed that are over 130 characters.
This commit is contained in:
committed by
Guido van Rossum
parent
0193ee87a8
commit
da7b04904c
@@ -185,8 +185,7 @@ you should know about.
|
||||
|
||||
Style conventions for stub files are different from PEP 8. The general
|
||||
rule is that they should be as concise as possible. Specifically:
|
||||
* there is no line length limit;
|
||||
* prefer long lines over elaborate indentation;
|
||||
* lines can be up to 130 characters long;
|
||||
* all function bodies should be empty;
|
||||
* prefer ``...`` over ``pass``;
|
||||
* prefer ``...`` on the same line as the class/function signature;
|
||||
|
||||
Reference in New Issue
Block a user