Skip to content

Commit

Permalink
Update formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed Nov 26, 2023
1 parent 2db2177 commit 24bca88
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
--decimalgrouping ignore
--ifdef no-indent
--self init-only
--shortoptionals except-properties
--wraparguments before-first
--wrapcollections before-first
--wrapconditions after-first
Expand All @@ -16,4 +17,4 @@
# rules

--lintonly unusedArguments
--enable isEmpty
--enable isEmpty, docComments
2 changes: 1 addition & 1 deletion Sources/Euclid+CoreText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public extension Mesh {
}

#if os(watchOS)
// Workaround for missing constants on watchOS
/// Workaround for missing constants on watchOS
extension NSAttributedString.Key {
static let font = NSAttributedString.Key(rawValue: "NSFont")
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Mesh.swift
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ extension Mesh {
var boundsIfSet: Bounds? { storage.boundsIfSet }
var watertightIfSet: Bool? { storage.watertightIfSet }
var isKnownConvex: Bool { storage.isConvex }
// Note: we don't expose submeshesIfSet because it's unsafe to reuse
/// Note: we don't expose submeshesIfSet because it's unsafe to reuse
var submeshesIfEmpty: [Mesh]? {
storage.submeshesIfSet.flatMap { $0.isEmpty ? [] : nil }
}
Expand Down
3 changes: 2 additions & 1 deletion Sources/Polygon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ public extension Polygon {
}

/// The position of the center of the polygon.
/// This is calculated as the average of the vertex positions, and may not be equal to the center of the polygon's ``bounds``.
/// This is calculated as the average of the vertex positions, and may not be equal to the center of the polygon's
/// ``bounds``.
var center: Vector {
vertices.reduce(.zero) { $0 + $1.position } / Double(vertices.count)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func pointsAreDegenerate(_ points: [Vector]) -> Bool {
return false
}

// Note: assumes points are not degenerate
/// Note: assumes points are not degenerate
func pointsAreConvex(_ points: [Vector]) -> Bool {
let count = points.count
guard count > 3, let a = points.last else {
Expand Down

0 comments on commit 24bca88

Please sign in to comment.