style: swiftformat pass — drift from the format gate
CI / ci (push) Canceled after 0s

Whole-tree swiftformat/swiftlint run during #136 flagged 9 files
drifted (/// doc markers on private members, one force-unwrap to
#require). Comment- and lint-only, no code change.
This commit is contained in:
AlexKucera committed 2026-10-27 18:32:30 +01:00
1 parent 5ad605eb3c
commit a4ea914690
9 files changed
+18 -27

No files matched your search

+1 -2
View File
@@ -75,8 +75,7 @@ nonisolated enum LearningsIndex {
) else { return [] }
var groups: [Group] = []
for dir in typeDirs.sorted(by: { $0.lastPathComponent < $1.lastPathComponent }) {
guard isPlainDirectory(dir), !dir.lastPathComponent.hasPrefix(".") else { continue }
guard let files = try? FileManager.default.contentsOfDirectory(at: dir, includingPropertiesForKeys: nil)
guard isPlainDirectory(dir), !dir.lastPathComponent.hasPrefix("."), let files = try? FileManager.default.contentsOfDirectory(at: dir, includingPropertiesForKeys: nil)
else { continue }
// #27: the pass clock feeds the decay verdict — clocked dirs
// carry their count, foreign dirs nil (no verdict; Entry's audit).
+2 -2
View File
@@ -728,8 +728,8 @@ extension MentorSessionModel {
guard method == "session/update",
let params,
let sid = params.objectValue?["sessionId"]?.stringValue,
transcripts[sid] != nil else { return }
guard let update = params.objectValue?["update"]?.objectValue else { return }
transcripts[sid] != nil,
let update = params.objectValue?["update"]?.objectValue else { return }
let kind = update["sessionUpdate"]?.stringValue ?? "unknown"
let replaying = sid == replayingSessionId
switch kind {
+1 -5
View File
@@ -678,11 +678,7 @@ extension OutlineEditorView {
private func endDrag(at point: CGPoint?, frames: [UUID: CGRect]?) {
let info = drag
drag = nil
guard let point, let info, let frames else { return }
guard let target = OutlinePresenter.hitTestDrop(point: point, rows: materializedRows(frames: frames)) else {
return
}
guard OutlinePresenter.applyDrop(target, moving: info.moving, in: &nodes) else { return }
guard let point, let info, let frames, let target = OutlinePresenter.hitTestDrop(point: point, rows: materializedRows(frames: frames)), OutlinePresenter.applyDrop(target, moving: info.moving, in: &nodes) else { return }
selectionAnchor = info.moving.first
focusedID = info.moving.last
pendingCaret = nil
+6 -7
View File
@@ -77,18 +77,17 @@ nonisolated struct Post: Identifiable, Equatable {
for projectDir in projects.sorted(by: { $0.lastPathComponent < $1.lastPathComponent }) {
let values = try? projectDir.resourceValues(forKeys: [.isDirectoryKey, .isSymbolicLinkKey])
guard values?.isDirectory ?? false, !(values?.isSymbolicLink ?? false),
!projectDir.lastPathComponent.hasPrefix(".") else { continue }
guard let entries = try? FileManager.default.contentsOfDirectory(
at: projectDir,
includingPropertiesForKeys: [.isDirectoryKey, .isSymbolicLinkKey],
) else { continue }
!projectDir.lastPathComponent.hasPrefix("."),
let entries = try? FileManager.default.contentsOfDirectory(
at: projectDir,
includingPropertiesForKeys: [.isDirectoryKey, .isSymbolicLinkKey],
) else { continue }
for dir in entries.sorted(by: { $0.lastPathComponent < $1.lastPathComponent }) {
let pieceValues = try? dir.resourceValues(forKeys: [.isDirectoryKey, .isSymbolicLinkKey])
guard pieceValues?.isDirectory ?? false, !(pieceValues?.isSymbolicLink ?? false),
!dir.lastPathComponent.hasPrefix(".") else { continue }
let fileURL = dir.appendingPathComponent("post.md")
guard let text = try? String(contentsOf: fileURL, encoding: .utf8) else { continue }
guard seen.insert(dir.lastPathComponent).inserted else { continue }
guard let text = try? String(contentsOf: fileURL, encoding: .utf8), seen.insert(dir.lastPathComponent).inserted else { continue }
let frontmatter = frontmatter(of: text)
posts.append(
Post(
+3 -3
View File
@@ -682,9 +682,9 @@ nonisolated extension PostStore {
}
try FileManager.default.createDirectory(at: research, withIntermediateDirectories: true)
let day = FixCardStore.formatted(Date(), "yyyyMMdd")
/// Flat single-line structural fields (Learning-file precedent): a
/// newline in a hostile title/url must not break the heading or the
/// frontmatter shape. Note/quote stay verbatim — they are content.
// Flat single-line structural fields (Learning-file precedent): a
// newline in a hostile title/url must not break the heading or the
// frontmatter shape. Note/quote stay verbatim — they are content.
func flat(_ value: String) -> String {
value.components(separatedBy: .newlines).joined(separator: " ")
}
+1 -2
View File
@@ -603,8 +603,7 @@ final class PostsModel {
/// main actor already; no re-hop needed.
private func startExternalWatch(url: URL) {
externalWatcher.onEvent = { [weak self] in
guard let self, let session = externalSession else { return }
guard let disk = try? String(contentsOf: url, encoding: .utf8) else { return }
guard let self, let session = externalSession, let disk = try? String(contentsOf: url, encoding: .utf8) else { return }
session.diskDidChange(diskText: disk)
}
externalWatcher.start(urls: [url.deletingLastPathComponent()])
+2 -4
View File
@@ -88,8 +88,7 @@ nonisolated enum ProseList {
guard buffer.length > 0 else { return nil }
let scanned = lines(in: text)
let caretLoc = min(max(0, caret), buffer.length - 1)
guard let idx = scanned.firstIndex(where: { NSLocationInRange(caretLoc, $0.range) }) else { return nil }
guard scanned[idx].isList else { return nil }
guard let idx = scanned.firstIndex(where: { NSLocationInRange(caretLoc, $0.range) }), scanned[idx].isList else { return nil }
let indent = scanned[idx].indent
let bounds = blockBounds(scanned, from: idx, indent: indent)
let blockEnd = scanned[bounds.end].end
@@ -154,8 +153,7 @@ nonisolated extension ProseList {
/// minus our indent. No previous sibling → nil (boundary no-op).
static func indent(_ item: Item, caret: Int, in text: String) -> Edit? {
let scanned = lines(in: text)
guard let idx = lineIndex(of: item.markerLine.location, in: scanned) else { return nil }
guard let sibIdx = adjacentSiblingLine(scanned, from: idx, through: idx, indent: item.indent, direction: -1) else { return nil }
guard let idx = lineIndex(of: item.markerLine.location, in: scanned), let sibIdx = adjacentSiblingLine(scanned, from: idx, through: idx, indent: item.indent, direction: -1) else { return nil }
let delta = contentColumn(scanned[sibIdx].text) - item.indent
guard delta > 0 else { return nil }
let body = blockBody(text, item.block)
+1 -1
View File
@@ -435,7 +435,7 @@ nonisolated enum ProsePresenter {
static let inlineSyntax: Set<Character> = ["*", "_", "`", "[", "]", "(", ")", "!", "<", ">"]
}
nonisolated extension Range where Bound == String.Index {
nonisolated extension Range<String.Index> {
func utf16Range(in base: String) -> Range<Int> {
let lo = base.utf16.distance(from: base.utf16.startIndex, to: lowerBound.samePosition(in: base.utf16)!)
let hi = base.utf16.distance(from: base.utf16.startIndex, to: upperBound.samePosition(in: base.utf16)!)
+1 -1
View File
@@ -88,7 +88,7 @@ struct ImportExternalTests {
// A UTF-16 encoded file: String(contentsOf: .utf8) fails → nil.
let ext = FileManager.default.temporaryDirectory
.appendingPathComponent("museion-ext-\(UUID().uuidString)-utf16.md")
let data = "# Title\n\nBody.".data(using: .utf16)!
let data = try #require("# Title\n\nBody.".data(using: .utf16))
try data.write(to: ext)
defer { try? FileManager.default.removeItem(at: ext) }