Skip to content

Commit fe93222

Browse files
author
Rob Amos
committed
Formatting
1 parent 97aa886 commit fe93222

28 files changed

+481
-82
lines changed

Examples/Examples/Dependencies.swift

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Vexil open source project
4+
//
5+
// Copyright (c) 2025 Unsigned Apps and the open source contributors.
6+
// Licensed under the MIT license
7+
//
8+
// See LICENSE for license information
9+
//
10+
// SPDX-License-Identifier: MIT
11+
//
12+
//===----------------------------------------------------------------------===//
13+
114
import Vexil
215

316
struct Dependencies {
@@ -6,7 +19,8 @@ struct Dependencies {
619
sources: FlagPole<FeatureFlags>.defaultSources + [RemoteFlags.values]
720
)
821

9-
@TaskLocal static var current = Dependencies()
22+
@TaskLocal
23+
static var current = Dependencies()
1024
}
1125

1226
enum RemoteFlags {

Examples/Examples/DoubleAndBooleanControlStyle.swift

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Vexil open source project
4+
//
5+
// Copyright (c) 2025 Unsigned Apps and the open source contributors.
6+
// Licensed under the MIT license
7+
//
8+
// See LICENSE for license information
9+
//
10+
// SPDX-License-Identifier: MIT
11+
//
12+
//===----------------------------------------------------------------------===//
13+
114
import SwiftUI
215
import Vexillographer
316

@@ -6,7 +19,7 @@ struct DoubleAndBooleanControlStyle: FlagControlStyle {
619
func makeBody(configuration: Configuration<CustomFlags.DoubleAndBoolean>) -> some View {
720
VStack {
821
Toggle(configuration.name, isOn: configuration.$value.isEnabled)
9-
Slider(value: configuration.$value.percent, in: 0...1.0) {
22+
Slider(value: configuration.$value.percent, in: 0 ... 1.0) {
1023
Text("Percent \(configuration.value.percent)")
1124
} minimumValueLabel: {
1225
Text("0.0")

Examples/Examples/ExamplesApp.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Vexil open source project
4+
//
5+
// Copyright (c) 2025 Unsigned Apps and the open source contributors.
6+
// Licensed under the MIT license
7+
//
8+
// See LICENSE for license information
9+
//
10+
// SPDX-License-Identifier: MIT
11+
//
12+
//===----------------------------------------------------------------------===//
13+
114
import SwiftUI
215

316
@main

Examples/Examples/FeatureFlags.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Vexil open source project
4+
//
5+
// Copyright (c) 2025 Unsigned Apps and the open source contributors.
6+
// Licensed under the MIT license
7+
//
8+
// See LICENSE for license information
9+
//
10+
// SPDX-License-Identifier: MIT
11+
//
12+
//===----------------------------------------------------------------------===//
13+
114
import Vexil
215

316
@FlagContainer

Examples/Examples/RootView.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Vexil open source project
4+
//
5+
// Copyright (c) 2025 Unsigned Apps and the open source contributors.
6+
// Licensed under the MIT license
7+
//
8+
// See LICENSE for license information
9+
//
10+
// SPDX-License-Identifier: MIT
11+
//
12+
//===----------------------------------------------------------------------===//
13+
114
import SwiftUI
215
import Vexil
316
import Vexillographer

Examples/ExamplesTests/ExamplesTests.swift

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
1-
import Testing
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Vexil open source project
4+
//
5+
// Copyright (c) 2025 Unsigned Apps and the open source contributors.
6+
// Licensed under the MIT license
7+
//
8+
// See LICENSE for license information
9+
//
10+
// SPDX-License-Identifier: MIT
11+
//
12+
//===----------------------------------------------------------------------===//
13+
214
@testable import Examples
15+
import Testing
316

417
struct ExamplesTests {
518

6-
@Test func example() async throws {
19+
@Test
20+
func example() async throws {
721
// Write your test here and use APIs like `#expect(...)` to check expected conditions.
822
}
923

Sources/Vexillographer/FlagControl/FlagControl.swift

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Vexil open source project
4+
//
5+
// Copyright (c) 2025 Unsigned Apps and the open source contributors.
6+
// Licensed under the MIT license
7+
//
8+
// See LICENSE for license information
9+
//
10+
// SPDX-License-Identifier: MIT
11+
//
12+
//===----------------------------------------------------------------------===//
13+
114
import SwiftUI
215
import Vexil
316

@@ -7,10 +20,13 @@ public struct FlagControl<Value: FlagValue, Content: View>: View {
720
private var wigwag: FlagWigwag<Value>
821
private var content: (FlagControlConfiguration<Value>) -> Content
922

10-
@State private var cachedValue: Value?
11-
@State private var seed = 0
23+
@State
24+
private var cachedValue: Value?
25+
@State
26+
private var seed = 0
1227

13-
@Environment(\.flagPoleContext) private var flagPoleContext
28+
@Environment(\.flagPoleContext)
29+
private var flagPoleContext
1430

1531
public init(
1632
_ wigwag: FlagWigwag<Value>,

Sources/Vexillographer/FlagControl/FlagControlConfiguration.swift

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Vexil open source project
4+
//
5+
// Copyright (c) 2025 Unsigned Apps and the open source contributors.
6+
// Licensed under the MIT license
7+
//
8+
// See LICENSE for license information
9+
//
10+
// SPDX-License-Identifier: MIT
11+
//
12+
//===----------------------------------------------------------------------===//
13+
114
import SwiftUI
215
import Vexil
316

@@ -12,7 +25,8 @@ public struct FlagControlConfiguration<Value: FlagValue> {
1225
public let isEditable: Bool
1326
public let hasValue: Bool
1427
public let defaultValue: Value
15-
@Binding public var value: Value
28+
@Binding
29+
public var value: Value
1630
private let _resetValue: () -> Void
1731

1832
init(
@@ -34,7 +48,7 @@ public struct FlagControlConfiguration<Value: FlagValue> {
3448
self.hasValue = hasValue
3549
self.defaultValue = defaultValue
3650
_value = value
37-
_resetValue = resetValue
51+
self._resetValue = resetValue
3852
}
3953

4054
public var key: String {

Sources/Vexillographer/FlagControl/FlagDetail.swift

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Vexil open source project
4+
//
5+
// Copyright (c) 2025 Unsigned Apps and the open source contributors.
6+
// Licensed under the MIT license
7+
//
8+
// See LICENSE for license information
9+
//
10+
// SPDX-License-Identifier: MIT
11+
//
12+
//===----------------------------------------------------------------------===//
13+
114
import SwiftUI
215
import Vexil
316

@@ -8,8 +21,10 @@ struct FlagDetailView<Value: FlagValue>: View {
821

922
var configuration: FlagControlConfiguration<Value>
1023

11-
@Environment(\.dismiss) private var dismiss
12-
@Environment(\.flagPoleContext) private var flagPoleContext
24+
@Environment(\.dismiss)
25+
private var dismiss
26+
@Environment(\.flagPoleContext)
27+
private var flagPoleContext
1328

1429
var body: some View {
1530
List {

Sources/Vexillographer/FlagControl/FlagPicker+Bool.swift

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Vexil open source project
4+
//
5+
// Copyright (c) 2025 Unsigned Apps and the open source contributors.
6+
// Licensed under the MIT license
7+
//
8+
// See LICENSE for license information
9+
//
10+
// SPDX-License-Identifier: MIT
11+
//
12+
//===----------------------------------------------------------------------===//
13+
114
import SwiftUI
215
import Vexil
316

@@ -25,7 +38,8 @@ private extension FlagValue where BoxedValueType == Bool? {
2538
}
2639

2740
protocol OptionalBooleanFlagPickerRepresentable {
28-
@MainActor func makeContent() -> any View
41+
@MainActor
42+
func makeContent() -> any View
2943
}
3044

3145
extension FlagControlConfiguration: OptionalBooleanFlagPickerRepresentable where Value.BoxedValueType == Bool? {

0 commit comments

Comments
 (0)