Commit ac7de0ce3c

ac7de0ce3cbd1f78be5d3828f510fb9064b1a968

parent: de690661f6

Unsigned

cmc <hello@cleberg.net> · 2026-04-19 20:46 UTC

fix: Sonar issues in BundleUserAgentTests and accept README URL path join

Layout: unified · split

Hutch.xcodeproj/project.pbxproj +8 −8
@@ -517,7 +517,7 @@
517517 ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
518518 CODE_SIGN_ENTITLEMENTS = Hutch/Hutch.entitlements;
519519 CODE_SIGN_STYLE = Automatic;
520 CURRENT_PROJECT_VERSION = 78;
520 CURRENT_PROJECT_VERSION = 79;
521521 DEVELOPMENT_TEAM = ZCNAX3VL9D;
522522 ENABLE_PREVIEWS = YES;
523523 GENERATE_INFOPLIST_FILE = YES;
@@ -534,7 +534,7 @@
534534 "$(inherited)",
535535 "@executable_path/Frameworks",
536536 );
537 MARKETING_VERSION = 3.1.10;
537 MARKETING_VERSION = 3.1.11;
538538 PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch;
539539 PRODUCT_NAME = "$(TARGET_NAME)";
540540 STRING_CATALOG_GENERATE_SYMBOLS = YES;
@@ -554,7 +554,7 @@
554554 ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
555555 CODE_SIGN_ENTITLEMENTS = Hutch/Hutch.entitlements;
556556 CODE_SIGN_STYLE = Automatic;
557 CURRENT_PROJECT_VERSION = 78;
557 CURRENT_PROJECT_VERSION = 79;
558558 DEVELOPMENT_TEAM = ZCNAX3VL9D;
559559 ENABLE_PREVIEWS = YES;
560560 GENERATE_INFOPLIST_FILE = YES;
@@ -571,7 +571,7 @@
571571 "$(inherited)",
572572 "@executable_path/Frameworks",
573573 );
574 MARKETING_VERSION = 3.1.10;
574 MARKETING_VERSION = 3.1.11;
575575 PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch;
576576 PRODUCT_NAME = "$(TARGET_NAME)";
577577 STRING_CATALOG_GENERATE_SYMBOLS = YES;
@@ -634,7 +634,7 @@
634634 APPLICATION_EXTENSION_API_ONLY = YES;
635635 CODE_SIGN_ENTITLEMENTS = HutchWidgetExtension/HutchWidgetExtension.entitlements;
636636 CODE_SIGN_STYLE = Automatic;
637 CURRENT_PROJECT_VERSION = 78;
637 CURRENT_PROJECT_VERSION = 79;
638638 DEVELOPMENT_TEAM = ZCNAX3VL9D;
639639 GENERATE_INFOPLIST_FILE = NO;
640640 INFOPLIST_FILE = HutchWidgetExtension/Info.plist;
@@ -644,7 +644,7 @@
644644 "@executable_path/Frameworks",
645645 "@executable_path/../../Frameworks",
646646 );
647 MARKETING_VERSION = 3.1.10;
647 MARKETING_VERSION = 3.1.11;
648648 PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch.HutchWidgetExtension;
649649 PRODUCT_NAME = "$(TARGET_NAME)";
650650 SKIP_INSTALL = YES;
@@ -663,7 +663,7 @@
663663 APPLICATION_EXTENSION_API_ONLY = YES;
664664 CODE_SIGN_ENTITLEMENTS = HutchWidgetExtension/HutchWidgetExtension.entitlements;
665665 CODE_SIGN_STYLE = Automatic;
666 CURRENT_PROJECT_VERSION = 78;
666 CURRENT_PROJECT_VERSION = 79;
667667 DEVELOPMENT_TEAM = ZCNAX3VL9D;
668668 GENERATE_INFOPLIST_FILE = NO;
669669 INFOPLIST_FILE = HutchWidgetExtension/Info.plist;
@@ -673,7 +673,7 @@
673673 "@executable_path/Frameworks",
674674 "@executable_path/../../Frameworks",
675675 );
676 MARKETING_VERSION = 3.1.10;
676 MARKETING_VERSION = 3.1.11;
677677 PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch.HutchWidgetExtension;
678678 PRODUCT_NAME = "$(TARGET_NAME)";
679679 SKIP_INSTALL = YES;
HutchTests/BundleUserAgentTests.swift +6 −4
@@ -9,7 +9,7 @@ import Testing
99private final class CapturingURLProtocol: URLProtocol, @unchecked Sendable {
1010 nonisolated(unsafe) static var capturedRequests: [URLRequest] = []
1111
12 override class func canInit(with request: URLRequest) -> Bool { true }
12 override class func canInit(with _: URLRequest) -> Bool { true }
1313 override class func canonicalRequest(for request: URLRequest) -> URLRequest { request }
1414
1515 override func startLoading() {
@@ -25,7 +25,9 @@ private final class CapturingURLProtocol: URLProtocol, @unchecked Sendable {
2525 client?.urlProtocolDidFinishLoading(self)
2626 }
2727
28 override func stopLoading() {}
28 override func stopLoading() {
29 // No cleanup is needed because the stub responds immediately in `startLoading()`.
30 }
2931
3032 static func makeSession() -> URLSession {
3133 let config = URLSessionConfiguration.ephemeral
@@ -79,10 +81,10 @@ struct BundleUserAgentTests {
7981 }
8082
8183 @Test
82 func sRHTClientSetsUserAgentOnFetchText() async {
84 func sRHTClientSetsUserAgentOnFetchText() async throws {
8385 CapturingURLProtocol.capturedRequests = []
8486 let client = SRHTClient(session: CapturingURLProtocol.makeSession(), token: "test-token")
85 let url = try! #require(URL(string: "https://builds.sr.ht/~test/job/1/log"))
87 let url = try #require(URL(string: "https://builds.sr.ht/~test/job/1/log"))
8688
8789 _ = try? await client.fetchText(url: url)
8890