mirror of
https://github.com/nicklockwood/SwiftFormat.git
synced 2026-06-16 10:34:34 +00:00
Add --redundanttype infer-locals-only option
This commit is contained in:
committed by
Nick Lockwood
parent
7c20b950c4
commit
aba7db2db2
@@ -777,8 +777,24 @@ private struct Examples {
|
||||
|
||||
let redundantType = """
|
||||
```diff
|
||||
// inferred
|
||||
- let view: UIView = UIView()
|
||||
+ let view = UIView()
|
||||
|
||||
// explicit
|
||||
- let view: UIView = UIView()
|
||||
+ let view: UIView = .init()
|
||||
|
||||
// infer-locals-only
|
||||
class Foo {
|
||||
- let view: UIView = UIView()
|
||||
+ let view: UIView = .init()
|
||||
|
||||
func method() {
|
||||
- let view: UIView = UIView()
|
||||
+ let view = UIView()
|
||||
}
|
||||
}
|
||||
```
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user