From df5a2554a89210a3cdebd5072dc208c7a5c87972 Mon Sep 17 00:00:00 2001 From: Johannes Ebeling Date: Tue, 23 Jul 2024 08:48:34 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=94=20Return=20empty=20string=20instea?= =?UTF-8?q?d=20of=20error=20when=20section=20is=20empty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/Changelog.swift | 17 +++++++++++++---- changelog.txt | 6 ------ 2 files changed, 13 insertions(+), 10 deletions(-) delete mode 100644 changelog.txt diff --git a/Sources/Changelog.swift b/Sources/Changelog.swift index 36766f3..2c71c22 100644 --- a/Sources/Changelog.swift +++ b/Sources/Changelog.swift @@ -1,14 +1,21 @@ +import ArgumentParser import Foundation import Markdown -import ArgumentParser +import OSLog + +extension Logger { + static let changelog = Logger(subsystem: "swift-changelog-parser", category: "changelog") + +} @main struct Changelog: ParsableCommand { + static let configuration = CommandConfiguration( abstract: "Get items from a Changelog.md file for a specific release or that are unreleased.", version: "1.0.0" ) - + enum Release: ExpressibleByArgument, CustomStringConvertible { case unreleased case release(String) @@ -35,7 +42,7 @@ struct Changelog: ParsableCommand { } } } - + @Argument(help: "Path to Changelog.md file") var path: String @@ -61,7 +68,9 @@ struct Changelog: ParsableCommand { let list = document.child(at: heading.indexInParent + 1) guard let list, list is UnorderedList else { - throw ValidationError("Changelog does not contain elements in the '\(release.description.localizedCapitalized)' section") + Logger.changelog.info("Changelog does not contain elements in the '\(release.description.localizedCapitalized, privacy: .public)' section") + print("") + return } print(list.format().trimmingCharacters(in: .whitespacesAndNewlines)) diff --git a/changelog.txt b/changelog.txt deleted file mode 100644 index bfaaf32..0000000 --- a/changelog.txt +++ /dev/null @@ -1,6 +0,0 @@ -- 🔥 No longer show AI features carousel after login -- 🐛 Start call from native recent calls -- 🐛 Crash on hangup -- 🔥 Remove support for deprecated deeplinks -- ✨ Showing new permission screen after login and if microphone permission is not granted. -- ✨ Settings & account redesign