question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Function arguments - one per line

See original GitHub issue

Wonderful plugin, I enjoy it a lot. Could you introduce an option to autocomplete function arguments one per line? Example:

turn this -> enumerate(iterable, start=0)
into      -> enumerate(iterable,
                       start=0)

This would be particularly useful for functions with a long signature such as pd.read_csv() in combination with “auto_complete_function_params”: “all”.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
edelvallecommented, Aug 13, 2018

I personally don’t like that style of indentation for parameters because is fragile to break during refactoring. if you have

variable = a_function(bla1,
                      bla2)

and you have to rename variable or a_function you have to fix the indentation of the parameters one by one, and there could be a few of them.

Uncle Bob (Rob Martin) advises to use this way instead:

variable = a_function(
    bla1,
    bla2,
)

Adding trailing commas also, so in case you have to remove or add a parameter only one line is modified.

0reactions
srusskihcommented, Aug 14, 2018

always welcome!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code Style: One argument per line in a multi-line function call
When splitting a function call over multiple lines, each parameter must be on a seperate line. Single line inline comments can take up...
Read more >
Enforce one function argument per line in Python
Enforce one function argument per line in Python ... Flake8 permits having multiple parameters on a single line when defining a function.
Read more >
Is it a bad idea to list every function/method argument on a ...
For me, one argument per line is easier to parse visually than two, three, or four arguments per line. And I always break...
Read more >
Question on forcing black to put one parameter per line #737
Here's an example: black collapsed three lines into one because a string literal got shortened so the whole argument list can now fit...
Read more >
[PSR-12] Function declarations with multiline arguments AND ...
When the argument list is split across multiple lines, the closing parenthesis and opening brace MUST be placed together on their own line...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found