In the style guide documentation it says the following:
Trailing comma
Use a trailing comma on the last line in arrays, dictionaries, and enums. This results in easier refactoring and better diffs in version control as the last line doesn’t need to be modified when adding new elements.
Does this also apply when writing functions with parameters with multiline formatting?
Example:
func _init(
filter: Callable,
image: Image,
suffix: String, # <- Should this comma be here?
) -> void:
## function body
The better diffs in version control still stands true, so this feels like the right choice.
I don’t like the syntax that much. I would only use this function argument syntax style if I have either a lot of arguments and/or have long argument names.
You can safely ignore the style guide. Format your code however you like, or if you’re in a team, hash it out as a team. Style guides are just opinions, even if they’re often presented as “best practices”.
Format your code however makes it most readable to you. The opinion of someone else who won’t have to read or maintain that code is of passing interest at best; maybe a source of ideas, but not a source of ground truth.