Skip to content

Commit 10a2fa4

Browse files
committed
Fix linting
1 parent 728f3ba commit 10a2fa4

21 files changed

+70
-70
lines changed

Sources/RichTextKit/Actions/RichTextAction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public enum RichTextAction: Identifiable, Equatable, RichTextLabelValue {
7878

7979
/// Step the line spacing.
8080
case stepLineSpacing(points: CGFloat)
81-
81+
8282
/// Set the current paragraph style.
8383
case setParagraphStyle(_ style: NSMutableParagraphStyle)
8484

Sources/RichTextKit/Bridging/RichTextViewComponent+Paragraph.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public extension RichTextViewComponent {
2222
var richTextParagraphStyle: NSMutableParagraphStyle? {
2323
richTextAttribute(.paragraphStyle)
2424
}
25-
25+
2626
/// Get a certain value from the current paragraph style.
2727
func richTextParagraphStyleValue<ValueType>(
2828
_ keyPath: WritableKeyPath<NSMutableParagraphStyle, ValueType>
@@ -44,7 +44,7 @@ public extension RichTextViewComponent {
4444
textStorageWrapper?.addAttribute(.paragraphStyle, value: style, range: range)
4545
#endif
4646
}
47-
47+
4848
/// Set a certain value for the current paragraph style.
4949
func setRichTextParagraphStyleValue<ValueType>(
5050
_ keyPath: WritableKeyPath<NSMutableParagraphStyle, ValueType>,
@@ -54,7 +54,7 @@ public extension RichTextViewComponent {
5454
style[keyPath: keyPath] = value
5555
setRichTextParagraphStyle(style)
5656
}
57-
57+
5858
/// Step a certain value for the current paragraph style.
5959
func stepRichTextParagraphStyleValue(
6060
_ keyPath: WritableKeyPath<NSMutableParagraphStyle, Int>,
@@ -63,7 +63,7 @@ public extension RichTextViewComponent {
6363
let current = richTextParagraphStyleValue(keyPath) ?? 0
6464
setRichTextParagraphStyleValue(keyPath, current + change)
6565
}
66-
66+
6767
/// Step a certain value for the current paragraph style.
6868
func stepRichTextParagraphStyleValue(
6969
_ keyPath: WritableKeyPath<NSMutableParagraphStyle, CGFloat>,

Sources/RichTextKit/Format/RichTextFormat+Sidebar.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public extension RichTextFormat {
6868

6969
SidebarSection {
7070
alignmentPicker(for: context)
71-
71+
7272
HStack {
7373
lineSpacingPicker(for: context)
7474
}

Sources/RichTextKit/Format/RichTextFormatToolbarBase.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extension RichTextFormatToolbarBase {
2727
}
2828

2929
extension RichTextFormatToolbarBase {
30-
30+
3131
func alignmentPicker(
3232
for context: RichTextContext
3333
) -> some View {

Sources/RichTextKit/Images/Image+RichText.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public extension Image {
2525
static let richTextAlignmentJustified = symbol("text.justify")
2626
static let richTextAlignmentLeft = symbol("text.alignleft")
2727
static let richTextAlignmentRight = symbol("text.alignright")
28-
28+
2929
static let richTextColorBackground = symbol("highlighter")
3030
static let richTextColorForeground = symbol("character")
3131
static let richTextColorReset = symbol("circle.slash")
@@ -60,7 +60,7 @@ public extension Image {
6060

6161
static let richTextSuperscriptDecrease = symbol("textformat.subscript")
6262
static let richTextSuperscriptIncrease = symbol("textformat.superscript")
63-
63+
6464
static let richTextUnknownValueType = symbol("questionmark")
6565
}
6666

Sources/RichTextKit/Keyboard/RichTextKeyboardToolbar+Config.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public struct RichTextKeyboardToolbarConfig {
3232

3333
/// Whether or not to always show the toolbar.
3434
public var alwaysDisplayToolbar: Bool
35-
35+
3636
/// Whether to display the format sheet button.
3737
public var displayFormatSheetButton: Bool
3838

Sources/RichTextKit/Keyboard/RichTextKeyboardToolbar.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ private extension RichTextKeyboardToolbar {
187187
.contentShape(Rectangle())
188188
}
189189
}
190-
190+
191191
RichTextStyle.ToggleStack(context: context)
192192
.keyboardShortcutsOnly(if: isCompact)
193193

Sources/RichTextKit/Paragraph/NSMutableParagraphStyle+PickerValues.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import SwiftUI
1010

1111
public extension KeyPath where Root == NSMutableParagraphStyle {
12-
12+
1313
/// Get default picker values for the key path.
1414
var defaultPickerValues: [Value]? {
1515
switch self {
@@ -37,63 +37,63 @@ public extension KeyPath where Root == NSMutableParagraphStyle {
3737
}
3838

3939
public extension NSLineBreakMode {
40-
40+
4141
/// Get the default picker values.
4242
static var defaultPickerValues: [Self] {
4343
.defaultPickerValues
4444
}
4545
}
4646

4747
public extension Collection where Element == NSLineBreakMode {
48-
48+
4949
/// Get the default picker values.
5050
static var defaultPickerValues: [Element] {
5151
[.byWordWrapping, .byCharWrapping, .byClipping, .byTruncatingHead, .byTruncatingTail, .byTruncatingMiddle]
5252
}
5353
}
5454

5555
public extension NSParagraphStyle.LineBreakStrategy {
56-
56+
5757
/// Get the default picker values.
5858
static var defaultPickerValues: [Self] {
5959
.defaultPickerValues
6060
}
6161
}
6262

6363
public extension Collection where Element == NSParagraphStyle.LineBreakStrategy {
64-
64+
6565
/// Get the default picker values.
6666
static var defaultPickerValues: [Element] {
6767
[.standard, .pushOut, .hangulWordPriority]
6868
}
6969
}
7070

7171
public extension NSTextAlignment {
72-
72+
7373
/// Get the default picker values.
7474
static var defaultPickerValues: [Self] {
7575
.defaultPickerValues
7676
}
7777
}
7878

7979
public extension Collection where Element == NSTextAlignment {
80-
80+
8181
/// Get the default picker values.
8282
static var defaultPickerValues: [Element] {
8383
[.left, .center, .right, .justified]
8484
}
8585
}
8686

8787
public extension NSWritingDirection {
88-
88+
8989
/// Get the default picker values.
9090
static var defaultPickerValues: [Self] {
9191
.defaultPickerValues
9292
}
9393
}
9494

9595
public extension Collection where Element == NSWritingDirection {
96-
96+
9797
/// Get the default picker values.
9898
static var defaultPickerValues: [Element] {
9999
[.leftToRight, .rightToLeft]

Sources/RichTextKit/Paragraph/NSMutableParagraphStyle+StepperInterval.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import SwiftUI
1010

1111
public extension KeyPath where Root == NSMutableParagraphStyle, Value: Hashable & Strideable {
12-
12+
1313
/// Get the default stepper interval for the key path.
1414
var defaultStepperInterval: Value? {
1515
switch self {

Sources/RichTextKit/Paragraph/NSMutableParagraphStyleValueLabel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import SwiftUI
1111
/// This internal view is used by the Picker when building a
1212
/// picker for a certain rich text paragraph value.
1313
public struct NSMutableParagraphStyleValueLabel<ValueType: Hashable, ValueLabel: View>: View {
14-
14+
1515
let values: [ValueType]
1616
let valueLabel: (ValueType) -> ValueLabel
17-
17+
1818
public var body: some View {
1919
ForEach(Array(values.enumerated()), id: \.offset) {
2020
valueLabel($0.element).tag($0.offset)

Sources/RichTextKit/Paragraph/NSParagraphStyle+Mutable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import SwiftUI
1010

1111
public extension NSMutableParagraphStyle {
12-
12+
1313
/// Create a mutable copy or a brand new instance.
1414
static var defaultMutable: NSMutableParagraphStyle {
1515
NSParagraphStyle.default.mutableCopy() as? NSMutableParagraphStyle ?? .init()

Sources/RichTextKit/Paragraph/NSParagraphStyle+Views.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import SwiftUI
1010

1111
public extension Image {
12-
12+
1313
/// Create a default icon for the provided key path.
1414
init?<ValueType>(for value: KeyPath<NSParagraphStyle, ValueType>) {
1515
guard let icon = value.defaultIcon else { return nil }
@@ -18,7 +18,7 @@ public extension Image {
1818
}
1919

2020
public extension KeyPath where Root == NSParagraphStyle {
21-
21+
2222
/// The default icon for the key path.
2323
var defaultIcon: Image? {
2424
switch self {
@@ -52,7 +52,7 @@ private func previewIcon<ValueType>(
5252
}
5353

5454
#Preview {
55-
55+
5656
List {
5757
previewIcon(for: \.alignment, ".alignment")
5858
previewIcon(for: \.baseWritingDirection, ".baseWritingDirection")

Sources/RichTextKit/Paragraph/NSTextAlignment+Views.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
import SwiftUI
1010

1111
extension NSTextAlignment: @retroactive Identifiable {
12-
12+
1313
public var id: Int { rawValue }
1414
}
1515

1616
public extension NSTextAlignment {
17-
17+
1818
/// The default icon for the text alignment.
1919
var defaultIcon: Image {
2020
switch self {
@@ -26,7 +26,7 @@ public extension NSTextAlignment {
2626
@unknown default: .richTextUnknownValueType
2727
}
2828
}
29-
29+
3030
#if iOS || macOS || os(visionOS)
3131
/// The default keyboard shortcut, if any.
3232
var defaultKeyboardShortcut: KeyboardShortcut? {
@@ -38,7 +38,7 @@ public extension NSTextAlignment {
3838
}
3939
}
4040
#endif
41-
41+
4242
/// The default label for the text alignment.
4343
var defaultLabel: some View {
4444
Label {
@@ -47,12 +47,12 @@ public extension NSTextAlignment {
4747
defaultIcon
4848
}
4949
}
50-
50+
5151
/// The standard title to use for the alignment.
5252
var defaultTitle: String {
5353
defaultTitleKey.text
5454
}
55-
55+
5656
/// The standard title key to use for the alignment.
5757
var defaultTitleKey: RTKL10n {
5858
switch self {

Sources/RichTextKit/Paragraph/Picker+RichTextParagraphValue.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import SwiftUI
1010

1111
public extension Picker {
12-
12+
1313
/// Creates a picker for a certain paragraph style value
1414
/// in the provided rich text context.
1515
init<ValueType: Hashable, ValueLabel: View>(
@@ -28,7 +28,7 @@ public extension Picker {
2828
label()
2929
}
3030
}
31-
31+
3232
/// Creates a picker for a certain paragraph style value
3333
/// in the provided paragraph style.
3434
init<ValueType: Hashable, ValueLabel: View>(
@@ -54,7 +54,7 @@ public extension Picker {
5454
}
5555

5656
private extension Picker {
57-
57+
5858
static func indexBinding<ValueType: Hashable>(
5959
for values: [ValueType],
6060
binding: Binding<ValueType>
@@ -69,14 +69,14 @@ private extension Picker {
6969
#Preview {
7070

7171
struct Preview: View {
72-
72+
7373
typealias ValueType = NSTextAlignment
7474
let keypath: KeyPath<NSParagraphStyle, NSTextAlignment> = \.alignment
7575
let writableKeypath: WritableKeyPath<NSMutableParagraphStyle, NSTextAlignment> = \.alignment
7676

7777
@State var alignment = ValueType.left
7878
@StateObject var context = RichTextContext()
79-
79+
8080
var value: ValueType {
8181
context.paragraphStyleValue(for: keypath)
8282
}

Sources/RichTextKit/Paragraph/Stepper+RichTextParagraphValue.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import SwiftUI
1010

1111
#if iOS || os(macOS) || os(visionOS)
1212
public extension Stepper {
13-
13+
1414
/// Creates a stepper for a paragraph style value in the
1515
/// provided rich text context.
1616
init<ValueType: Hashable & Strideable & Comparable & SignedNumeric>(
@@ -25,7 +25,7 @@ public extension Stepper {
2525
label: label
2626
)
2727
}
28-
28+
2929
/// Creates a stepper for a paragraph style value in the
3030
/// provided paragraph style.
3131
init<ValueType: Hashable & Strideable & Comparable & SignedNumeric>(
@@ -49,12 +49,12 @@ public extension Stepper {
4949
#Preview {
5050

5151
struct Preview: View {
52-
52+
5353
let keypath: KeyPath<NSParagraphStyle, CGFloat> = \.lineSpacing
5454
let writableKeypath: WritableKeyPath<NSMutableParagraphStyle, CGFloat> = \.lineSpacing
5555

5656
@StateObject var context = RichTextContext()
57-
57+
5858
var value: Double {
5959
context.paragraphStyleValue(for: keypath)
6060
}

Sources/RichTextKit/Paragraph/Toggle+RichTextParagraphValue.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import SwiftUI
1010

1111
public extension Toggle {
12-
12+
1313
/// Creates a toggle for a certain paragraph style value
1414
/// in the provided rich text context.
1515
init(
@@ -22,7 +22,7 @@ public extension Toggle {
2222
label: label
2323
)
2424
}
25-
25+
2626
/// Creates a toggle for a certain paragraph style value
2727
/// in the provided paragraph style.
2828
init(
@@ -44,12 +44,12 @@ public extension Toggle {
4444
#Preview {
4545

4646
struct Preview: View {
47-
47+
4848
let keypath: KeyPath<NSParagraphStyle, Bool> = \.allowsDefaultTighteningForTruncation
4949
let writableKeypath: WritableKeyPath<NSMutableParagraphStyle, Bool> = \.allowsDefaultTighteningForTruncation
5050

5151
@StateObject var context = RichTextContext()
52-
52+
5353
var value: Bool {
5454
context.paragraphStyleValue(for: keypath)
5555
}

0 commit comments

Comments
 (0)