Code Monkey home page Code Monkey logo

Comments (7)

tscholze avatar tscholze commented on June 15, 2024 1

Thanks buddy! Your work is amazing!

from swiftformat.

nicklockwood avatar nicklockwood commented on June 15, 2024

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
) {
    ...
}

from swiftformat.

tscholze avatar tscholze commented on June 15, 2024

@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.

from swiftformat.

nicklockwood avatar nicklockwood commented on June 15, 2024

Ah, OK. That could be a bug - I'll check.

from swiftformat.

nicklockwood avatar nicklockwood commented on June 15, 2024

@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).

from swiftformat.

nicklockwood avatar nicklockwood commented on June 15, 2024

@tscholze fixed in 0.52.5. Thanks for the report!

from swiftformat.

tscholze avatar tscholze commented on June 15, 2024

Thanks! ❤️

from swiftformat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.