Closed tscholze closed 10 months ago
If I understand correctly, you want something like this?
func foo(bar,
baz) {
...
}
Instead of this?
func foo(bar,
baz)
{
...
}
If so, there's current no option for that, however this style is supported if that would work for you?
func foo(
bar,
baz
) {
...
}
@nicklockwood thanks for your blazing fast reply. I meant something else. Maybe the following sample helps to understand my confusing words.
Input
func application(_: UIApplication, willFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool
{
//
}
and
func applicationDidEnterBackground(_: UIApplication)
{
//
}
Output after the formatter run
func application(_: UIApplication, willFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool
{
//
}
and
func applicationDidEnterBackground(_: UIApplication) {
//
}
Expected behavior
I would expect that both function will get their {
moved to the same lane as the method header is and not just only on the "shorter" applicationDidEnterBackground
.
This behavior occurs on every "long" method name.
Ah, OK. That could be a bug - I'll check.
Thanks buddy! Your work is amazing!
@tscholze I found the issue. For some reason I don't recall, the code was set not to unwrap braces if the width would exceed 100 chars. I'll remove that limit, but in the meantime you can override it by setting --maxwidth 120
(or whatever).
@tscholze fixed in 0.52.5. Thanks for the report!
Thanks! ❤️
Is it configurable that if the style
alman = false
is applied, that the opening bracket on a method will still be on the same line as the function itself?This is no problem if the function name is short, but if you have some
AppDelegate
methods, the alman style will not be applied.