Details
-
Type:
RFC
-
Status: Implemented
-
Resolution: Done
-
Component/s: DM
-
Labels:None
-
Location:This ticket
Description
Our current Python coding standard is to break long lines at a binary operator by having the binary operator at the end of the line. I propose to change this, for two reasons:
- The puts a critical piece of information (the binary operator) first, where it is easy to see and not lost in a sea of text.
- It matches what "black" does. So if we start formatting any of our packages with "black" the results will look familiar. (see
RFC-649).
My proposed means of adoption is:
- Change one package at a time, as time permits and people have inclination.
- Change a package by first changing setup.cfg to suppress W503 instead of W504 (they are complementary), then fixing any flake8 warnings.
I believe that continuation lines are rare enough and that existing code is readable enough, that there is no rush on making this change. I envision it as something someone might choose to do if one is already editing a package.
Attachments
Issue Links
- is triggering
-
DM-23090 Update LATISS filters in obs_lsst to match commissioning filters
- Done
-
DM-23162 Change python style guide to match RFC-650
- Done
-
DM-23173 Implement RFC-650: update packages to prefer binary operators at the beginning of continued lines
- Done
- relates to
-
DM-23181 Implement RFC-650 (W503 exception) in stack_package template
- Done
-
RFC-649 Allow formatting python code with "black"
- Withdrawn
I'm fine with this.