Skip to content

Commit

Permalink
Run with consecutiveBlankLines
Browse files Browse the repository at this point in the history
  • Loading branch information
msrutek-paylocity committed Feb 6, 2024
1 parent 561e7ba commit 061f6fc
Show file tree
Hide file tree
Showing 25 changed files with 1 addition and 69 deletions.
1 change: 1 addition & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
--swiftversion 5.8

# rules
--rules consecutiveBlankLines
--rules consecutiveSpaces
--rules trailingSpace
1 change: 0 additions & 1 deletion Sources/RichTextKit/Actions/RichTextAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ public extension RichTextAction {
}
}


// MARK: - Aliases

public extension RichTextAction {
Expand Down
1 change: 0 additions & 1 deletion Sources/RichTextKit/Colors/ColorRepresentable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import AppKit
public typealias ColorRepresentable = NSColor
#endif


#if iOS || os(tvOS) || os(watchOS) || os(visionOS)
import UIKit

Expand Down
3 changes: 0 additions & 3 deletions Sources/RichTextKit/Component/RichTextViewComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public protocol RichTextViewComponent: AnyObject,
/// The text view current typing attributes.
var typingAttributes: RichTextAttributes { get set }


// MARK: - Setup

/// Setup the view with a text and data format.
Expand All @@ -62,7 +61,6 @@ public protocol RichTextViewComponent: AnyObject,
format: RichTextDataFormat
)


// MARK: - Functions

/// Show an alert with a title, message and button text.
Expand All @@ -87,7 +85,6 @@ public protocol RichTextViewComponent: AnyObject,
func undoLatestChange()
}


// MARK: - Public Extension

public extension RichTextViewComponent {
Expand Down
1 change: 0 additions & 1 deletion Sources/RichTextKit/Context/RichTextContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public class RichTextContext: ObservableObject {
/// The currently selected range, if any.
public internal(set) var selectedRange = NSRange()


// MARK: - Public properies

/// Whether or not the text is currently being edited.
Expand Down
7 changes: 0 additions & 7 deletions Sources/RichTextKit/Coordinator/RichTextCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ open class RichTextCoordinator: NSObject {
subscribeToUserActions()
}


// MARK: - Properties

/// The rich text context to coordinate with.
Expand All @@ -66,7 +65,6 @@ open class RichTextCoordinator: NSObject {
/// This flag is used to avoid delaying context sync.
var shouldDelaySyncContextWithTextView = true


// MARK: - Internal Properties

/**
Expand All @@ -81,7 +79,6 @@ open class RichTextCoordinator: NSObject {
*/
var highlightedRangeOriginalForegroundColor: ColorRepresentable?


#if canImport(UIKit)

// MARK: - UITextViewDelegate
Expand All @@ -103,7 +100,6 @@ open class RichTextCoordinator: NSObject {
}
#endif


#if canImport(AppKit) && !targetEnvironment(macCatalyst)

// MARK: - NSTextViewDelegate
Expand All @@ -126,7 +122,6 @@ open class RichTextCoordinator: NSObject {
#endif
}


#if iOS || os(tvOS) || os(visionOS)
import UIKit

Expand All @@ -138,7 +133,6 @@ import AppKit
extension RichTextCoordinator: NSTextViewDelegate {}
#endif


// MARK: - Public Extensions

public extension RichTextCoordinator {
Expand All @@ -155,7 +149,6 @@ public extension RichTextCoordinator {
}
}


// MARK: - Internal Extensions

extension RichTextCoordinator {
Expand Down
4 changes: 0 additions & 4 deletions Sources/RichTextKit/Fonts/RichTextFont+PickerFont.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public extension RichTextFont {
}
}


// MARK: - Static Properties

public extension RichTextFont.PickerFont {
Expand Down Expand Up @@ -92,7 +91,6 @@ public extension RichTextFont.PickerFont {
}
}


// MARK: - Public Properties

public extension RichTextFont.PickerFont {
Expand All @@ -113,7 +111,6 @@ public extension RichTextFont.PickerFont {
}
}


// MARK: - Collection Extensions

public extension Collection where Element == RichTextFont.PickerFont {
Expand All @@ -135,7 +132,6 @@ public extension Collection where Element == RichTextFont.PickerFont {
}
}


// MARK: - System Fonts

private extension RichTextFont.PickerFont {
Expand Down
1 change: 0 additions & 1 deletion Sources/RichTextKit/Format/RichTextFormatSidebar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public struct RichTextFormatSidebar: View {
}
}


private struct SidebarSection<Content: View>: View {

let title: String?
Expand Down
2 changes: 0 additions & 2 deletions Sources/RichTextKit/Images/RichTextImageAttachment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,13 @@ open class RichTextImageAttachment: NSTextAttachment {
super.init(coder: coder)
}


/**
Whether or not the attachment supports secure coding.

This attachment type supports secure coding by default.
*/
public override class var supportsSecureCoding: Bool { true }


#if iOS || os(tvOS) || os(visionOS)
/**
Get or set the attachment image.
Expand Down
5 changes: 0 additions & 5 deletions Sources/RichTextKit/RichTextEditor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public struct RichTextEditor: ViewRepresentable {
}
#endif


public func makeCoordinator() -> RichTextCoordinator {
RichTextCoordinator(
text: text,
Expand All @@ -98,7 +97,6 @@ public struct RichTextEditor: ViewRepresentable {
)
}


#if iOS || os(tvOS) || os(visionOS)
public func makeUIView(context: Context) -> some UIView {
textView.setup(with: text.wrappedValue, format: format)
Expand All @@ -122,7 +120,6 @@ public struct RichTextEditor: ViewRepresentable {
#endif
}


// MARK: RichTextPresenter

public extension RichTextEditor {
Expand All @@ -133,7 +130,6 @@ public extension RichTextEditor {
}
}


// MARK: RichTextReader

public extension RichTextEditor {
Expand All @@ -144,7 +140,6 @@ public extension RichTextEditor {
}
}


// MARK: RichTextWriter

public extension RichTextEditor {
Expand Down
6 changes: 0 additions & 6 deletions Sources/RichTextKit/RichTextView_AppKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ open class RichTextView: NSTextView, RichTextViewComponent {
/// The image configuration to use by the rich text view.
public var imageConfiguration: RichTextImageConfiguration = .disabled


// MARK: - Overrides

/// Paste the current pasteboard content into the view.
Expand Down Expand Up @@ -93,7 +92,6 @@ open class RichTextView: NSTextView, RichTextViewComponent {
.scrollWheel(with: event)
}


// MARK: - Setup

/**
Expand Down Expand Up @@ -122,7 +120,6 @@ open class RichTextView: NSTextView, RichTextViewComponent {
setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
}


// MARK: - Open Functionality

/**
Expand Down Expand Up @@ -172,7 +169,6 @@ open class RichTextView: NSTextView, RichTextViewComponent {
}
}


// MARK: - Public Extensions

public extension RichTextView {
Expand All @@ -189,7 +185,6 @@ public extension RichTextView {
}
}


// MARK: - RichTextProvider

public extension RichTextView {
Expand All @@ -206,7 +201,6 @@ public extension RichTextView {
}
}


// MARK: - RichTextWriter

public extension RichTextView {
Expand Down
12 changes: 0 additions & 12 deletions Sources/RichTextKit/RichTextView_UIKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ extension RichTextView: UIDropInteractionDelegate {}
*/
open class RichTextView: UITextView, RichTextViewComponent {


// MARK: - Initializers

public convenience init(
Expand All @@ -45,7 +44,6 @@ open class RichTextView: UITextView, RichTextViewComponent {
self.setup(with: string, format: format)
}


// MARK: - Properties

/// The configuration to use by the rich text view.
Expand Down Expand Up @@ -74,7 +72,6 @@ open class RichTextView: UITextView, RichTextViewComponent {
}
}


#if iOS || os(visionOS)

/// The image drop interaction to use.
Expand All @@ -89,14 +86,12 @@ open class RichTextView: UITextView, RichTextViewComponent {

#endif


/// Keeps track of the first time a valid frame is set.
private var isInitialFrameSetupNeeded = true

/// Keeps track of the data format used by the view.
private var richTextDataFormat: RichTextDataFormat = .archivedData


// MARK: - Overrides

/**
Expand Down Expand Up @@ -144,7 +139,6 @@ open class RichTextView: UITextView, RichTextViewComponent {
}
#endif


// MARK: - Setup

/**
Expand Down Expand Up @@ -175,7 +169,6 @@ open class RichTextView: UITextView, RichTextViewComponent {
setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
}


// MARK: - Open Functionality

/// Alert a certain title and message.
Expand Down Expand Up @@ -245,7 +238,6 @@ open class RichTextView: UITextView, RichTextViewComponent {
undoManager?.undo()
}


#if iOS || os(visionOS)

// MARK: - UIDropInteractionDelegate
Expand Down Expand Up @@ -296,7 +288,6 @@ open class RichTextView: UITextView, RichTextViewComponent {
performTextDrop(with: session, at: range)
}


// MARK: - Drop Interaction Support

/**
Expand Down Expand Up @@ -357,7 +348,6 @@ private extension UIDropSession {
}
#endif


// MARK: - Public Extensions

public extension RichTextView {
Expand Down Expand Up @@ -385,7 +375,6 @@ public extension RichTextView {
}
}


// MARK: - RichTextProvider

public extension RichTextView {
Expand All @@ -397,7 +386,6 @@ public extension RichTextView {
}
}


// MARK: - RichTextWriter

public extension RichTextView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public extension RichTextViewComponent {
richTextFont?.pointSize
}


@available(*, deprecated, renamed: "currentColor(_:)")
var currentBackgroundColor: ColorRepresentable? {
currentColor(.background)
Expand Down Expand Up @@ -145,7 +144,6 @@ public extension RichTextViewComponent {
setRichTextAlignment(alignment)
}


@available(*, deprecated, message: "richTextColor(_:)")
func currentColor(_ color: RichTextColor) -> ColorRepresentable? {
richTextColor(color)
Expand All @@ -158,7 +156,6 @@ public extension RichTextViewComponent {
setRichTextAttribute(attribute, to: val)
}


@available(*, deprecated, message: "richTextFont")
var currentFont: FontRepresentable? {
richTextFont
Expand Down Expand Up @@ -194,7 +191,6 @@ public extension RichTextViewComponent {
stepRichTextFontSize(points: points)
}


@available(*, deprecated, message: "richTextIndent")
var currentIndent: CGFloat? {
richTextIndent
Expand All @@ -207,7 +203,6 @@ public extension RichTextViewComponent {
stepRichTextIndent(points: points)
}


@available(*, deprecated, message: "richTextStyles")
var currentRichTextStyles: [RichTextStyle] {
richTextStyles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ final class String_ParagraphTests: XCTestCase {
XCTAssertEqual(currentResult(for: multi, from: 10), 8)
}


func testIndexOfNextParagraphIsCorrectForEmptyString() {
XCTAssertEqual(nextResult(for: "", from: 0), 0)
XCTAssertEqual(nextResult(for: "", from: 20), 0)
Expand Down
Loading

0 comments on commit 061f6fc

Please sign in to comment.