PEP 7: Add note about greppable exception messages (#2605)

Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
This commit is contained in:
Erlend Egeberg Aasland 2022-05-14 01:23:19 +02:00 committed by GitHub
parent 703362a544
commit c787739478
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -71,6 +71,12 @@ Code lay-out
previous rule together don't give you enough room to code, your code previous rule together don't give you enough room to code, your code
is too complicated -- consider using subroutines. is too complicated -- consider using subroutines.
* Strive to keep exception message string literals on one line,
in order to make them easily greppable.
If your exception message breaks the 79 character line width rule,
try to mitigate it by reducing indent, or just bend that rule.
(Practicality beats purity.)
* No line should end in whitespace. If you think you need significant * No line should end in whitespace. If you think you need significant
trailing whitespace, think again -- somebody's editor might delete trailing whitespace, think again -- somebody's editor might delete
it as a matter of routine. it as a matter of routine.