Knob to allow alternative formatting of call chains
See original GitHub issueIn addition to the standard method of getting call chains formatted like this:
rawKPIs = KPIsSession.query(
KPI.name, KPI.value, KPI.created
).filter(KPI.entryId == entryID).filter(KPI.subsetId is None).filter(
KPI.created >= fromUnixTimestamp(fromTimestamp)
).filter(KPI.created <= fromUnixTimestamp(toTimestamp)).filter(
func.unix_timestamp(KPI.created) % moduloSelector == 0
).order_by(KPI.name, KPI.created).all()
Allow formatting as:
rawKPIs = \
KPIsSession.query(
KPI.name, KPI.value, KPI.created
).filter(
KPI.entryId == entryID
).filter(
KPI.subsetId is None
).filter(
KPI.created >= fromTimestamp
).filter(
KPI.created <= toTimestamp
).filter(
KPI.created % moduloSelector == 0
).order_by(
KPI.name, KPI.created
).all()
or:
rawKPIs = \
KPIsSession.query(KPI.name, KPI.value, KPI.created) \
.filter(KPI.entryId == entryID) \
.filter(KPI.subsetId is None) \
.filter(KPI.created >= fromTimestamp) \
.filter(KPI.created <= toTimestamp) \
.filter(KPI.created % moduloSelector == 0) \
.order_by(KPI.name, KPI.created) \
.all()
This makes the code more readable and stack traces clearer. (due to line number)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:8
- Comments:15 (2 by maintainers)
Top Results From Across the Web
Inconsistent formating of long method call chains #3157 - GitHub
I turned out to be really hard to get consistently great formatting for chains. Although this is not great, I think the alternatives...
Read more >Yocto-Knob : User's guide
The Yocto-Knob is a 45x20mm electronic module which allows you to measure the state of switches, push buttons, or potentiometers.
Read more >axblack - PyPI
This is a forked alternative to the official black formatter, ... call chains are now formatted according to the fluent interfaces style (#67)....
Read more >Change a control's Bitmap at run time? [Archive] - Cockos ...
I have been thinking about this, too. It would allow for users to customize the knobs, and it would also allow for some...
Read more >ASCII Protocol Manual - Zaber
If there is more than one device in a chain, sending the command /move abs 10000 will move all ... The axis is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi. I’m confused by the comments here. Assuming I already have
( )
surrounding my chained call, is it possible to configure yapf to do this?Right now my yapf (0.20) turns that code into this, which is far from what I want 😉.
I have a lot of chained calls in my pyspark application, and poor formatting of those is the one reason preventing me from using yapf. Ideally I’d like something like in the first quoted fragment.
Another idea is adding parenthesis, but this is obviously more problematic: