Comments (7)
Thanks buddy! Your work is amazing!
from swiftformat.
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.
@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.
Ah, OK. That could be a bug - I'll check.
from swiftformat.
@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.
@tscholze fixed in 0.52.5. Thanks for the report!
from swiftformat.
Thanks! ❤️
from swiftformat.
Related Issues (20)
- --operatorfunc defaults to no-space HOT 4
- `redundantParens` removes required paranthesis for optional function calls. HOT 1
- `fileHeader` option not working with Xcode extension HOT 2
- hoistTry rule issues HOT 2
- Can some or all of the rules be implemented using SwiftSyntax? HOT 3
- The `redundantLet` rule can break SwiftUI views that use `let _ = print()` inside an overlay HOT 1
- `redundantLet` rule on global actor annotated closures HOT 1
- 0.52.4 did not get marked as latest release HOT 1
- Incorrect removal of return in if within a failable init HOT 1
- Problems with `sortTypealiases` rule HOT 2
- Comment before `--ifdef` results in unexpected modifier indentation HOT 2
- docComments don't work for code inside #if HOT 2
- Xcode 15 recommended settings cause sandbox reports for BuildTools HOT 2
- Question: Wrap function calls HOT 7
- `hoistAwait` removes necessary `await` for operators/functions with async autoclosures. HOT 5
- opaqueGenericParameters cannot be disabled? HOT 8
- redundantReturn removes return statements of consecutive if statements HOT 4
- conditionalAssignment matches expression within try block HOT 11
- Rule Request: Remove redundant parenthesis from closures HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftformat.