Closed Rastko-V-P closed 6 years ago
@Rastko-V-P sounds interesting! Thanks for feedback!
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.
@edalvalle Yes, that's a popular alternative, both formatting styles could be offered as an option. I still prefer the first style because it improves readability and saves 2 lines. Indentation of all parameters can be done in a single go in Sublime.
@Rastko-V-P have you tried some auto-formatting tools for python? (: like this - https://github.com/csurfer/sublime_black
Good point, solved it with PyYapf, thanks for the tip.
always welcome!
Wonderful plugin, I enjoy it a lot. Could you introduce an option to autocomplete function arguments one per line? Example:
This would be particularly useful for functions with a long signature such as pd.read_csv() in combination with "auto_complete_function_params": "all".