From d478b8c55acde129d996d7bf585c5c6146736e2d Mon Sep 17 00:00:00 2001 From: Ras Date: Thu, 19 Jun 2025 13:02:24 +0900 Subject: [PATCH 1/7] Update dependencies --- Package.resolved | 18 +++++++++--------- Package.swift | 14 +++++++------- Tools/Package.resolved | 26 +++++++++++++------------- Tools/Package.swift | 4 ++-- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Package.resolved b/Package.resolved index ca33412..b6e53ac 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,13 +1,13 @@ { - "originHash" : "49d24ece49d7491e223d2db9c9de55a04e033203d984a1aef05c176f2baee5a8", + "originHash" : "9e3d82a044dc108985daf5f5e11d1acf232020bce18fd8bfe8bdae2997aa4211", "pins" : [ { "identity" : "swift-argument-parser", "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-argument-parser.git", "state" : { - "revision" : "41982a3656a71c768319979febd796c6fd111d5c", - "version" : "1.5.0" + "revision" : "011f0c765fb46d9cac61bca19be0527e99c98c8b", + "version" : "1.5.1" } }, { @@ -15,8 +15,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/swiftlang/swift-syntax.git", "state" : { - "revision" : "2bc86522d115234d1f588efe2bcb4ce4be8f8b82", - "version" : "510.0.3" + "revision" : "f99ae8aa18f0cf0d53481901f88a0991dc3bd4a2", + "version" : "601.0.1" } }, { @@ -24,8 +24,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/swiftlang/swift-tools-support-core.git", "state" : { - "revision" : "5b130e04cc939373c4713b91704b0c47ceb36170", - "version" : "0.7.1" + "revision" : "e8fbc8b05a155f311b862178d92d043afb216fe3", + "version" : "0.7.3" } }, { @@ -33,8 +33,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/jpsim/Yams.git", "state" : { - "revision" : "3036ba9d69cf1fd04d433527bc339dc0dc75433d", - "version" : "5.1.3" + "revision" : "7568d1c6c63a094405afb32264c57dc4e1435835", + "version" : "6.0.1" } } ], diff --git a/Package.swift b/Package.swift index c36ee94..a1dcab1 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.1 import PackageDescription @@ -11,13 +11,13 @@ let package = Package( .executable( name: "swift-mod", targets: ["swift-mod"] - ) + ), ], dependencies: [ - .package(url: "https://github.com/apple/swift-argument-parser.git", exact: "1.5.0"), - .package(url: "https://github.com/swiftlang/swift-syntax.git", exact: "510.0.3"), - .package(url: "https://github.com/swiftlang/swift-tools-support-core.git", exact: "0.7.1"), - .package(url: "https://github.com/jpsim/Yams.git", exact: "5.1.3") + .package(url: "https://github.com/apple/swift-argument-parser.git", exact: "1.5.1"), + .package(url: "https://github.com/swiftlang/swift-syntax.git", exact: "601.0.1"), + .package(url: "https://github.com/swiftlang/swift-tools-support-core.git", exact: "0.7.3"), + .package(url: "https://github.com/jpsim/Yams.git", exact: "6.0.1") ], targets: [ .executableTarget( @@ -56,5 +56,5 @@ let package = Package( dependencies: ["SwiftModCore"] ), ], - swiftLanguageVersions: [.v5] + swiftLanguageModes: [.v6] ) diff --git a/Tools/Package.resolved b/Tools/Package.resolved index c45d393..cea370b 100644 --- a/Tools/Package.resolved +++ b/Tools/Package.resolved @@ -1,22 +1,22 @@ { - "originHash" : "7b87ceb41a0f3350b9201125895daf78c4f6a14bddd14dbaba4001f12762f213", + "originHash" : "6271efa0c28a070d25aab4859888f006d455cf5c4b541e079fc086275e1e8d6d", "pins" : [ { "identity" : "swift-argument-parser", "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-argument-parser.git", "state" : { - "revision" : "41982a3656a71c768319979febd796c6fd111d5c", - "version" : "1.5.0" + "revision" : "011f0c765fb46d9cac61bca19be0527e99c98c8b", + "version" : "1.5.1" } }, { "identity" : "swift-cmark", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-cmark.git", + "location" : "https://github.com/swiftlang/swift-cmark.git", "state" : { - "revision" : "3ccff77b2dc5b96b77db3da0d68d28068593fa53", - "version" : "0.5.0" + "revision" : "b022b08312decdc46585e0b3440d97f6f22ef703", + "version" : "0.6.0" } }, { @@ -24,8 +24,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/swiftlang/swift-format.git", "state" : { - "revision" : "7996ac678197d293f6c088a1e74bb778b4e10139", - "version" : "510.1.0" + "revision" : "ffbb3225ffda37b62c7283c70e87e8bc7e8e202a", + "version" : "601.0.0" } }, { @@ -33,17 +33,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-markdown.git", "state" : { - "revision" : "8f79cb175981458a0a27e76cb42fee8e17b1a993", - "version" : "0.5.0" + "revision" : "ea79e83c8744d2b50b0dc2d5bbd1e857e1253bf9", + "version" : "0.6.0" } }, { "identity" : "swift-syntax", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-syntax.git", + "location" : "https://github.com/swiftlang/swift-syntax.git", "state" : { - "revision" : "2bc86522d115234d1f588efe2bcb4ce4be8f8b82", - "version" : "510.0.3" + "revision" : "f99ae8aa18f0cf0d53481901f88a0991dc3bd4a2", + "version" : "601.0.1" } } ], diff --git a/Tools/Package.swift b/Tools/Package.swift index 1733fd9..658ea26 100644 --- a/Tools/Package.swift +++ b/Tools/Package.swift @@ -1,10 +1,10 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.1 import PackageDescription let package = Package( name: "Tools", dependencies: [ - .package(url: "https://github.com/swiftlang/swift-format.git", exact: "510.1.0"), + .package(url: "https://github.com/swiftlang/swift-format.git", exact: "601.0.0"), ] ) From 8746c696bd0411fdcde25e04e1cb3564ab71cfca Mon Sep 17 00:00:00 2001 From: Ras Date: Thu, 19 Jun 2025 13:02:39 +0900 Subject: [PATCH 2/7] Adopt Swift 6 --- Sources/SwiftModCommands/Arguments.swift | 4 +-- .../Configuration+Template.swift | 2 +- Sources/SwiftModCommands/InitCommand.swift | 2 +- Sources/SwiftModCommands/RulesCommand.swift | 2 +- Sources/SwiftModCommands/RunCommand.swift | 2 +- .../Runners/RunCommandRunner.swift | 4 +-- Sources/SwiftModCore/Format.swift | 2 +- Sources/SwiftModCore/Helpers/Atomic.swift | 2 +- .../Helpers/InteractiveWriter.swift | 19 +++++++++++- .../SwiftModCore/Helpers/RulePipeline.swift | 2 +- Sources/SwiftModCore/Indent.swift | 2 +- Sources/SwiftModCore/RuleDescription.swift | 12 ++++--- Sources/SwiftModCore/RulePriority.swift | 2 +- .../DefaultAccessLevelRule.swift | 4 +-- .../DefaultMemberwiseInitializerRule.swift | 31 +++++++++++-------- Sources/swift-mod/SwiftMod.swift | 2 +- .../Configuration+CodableTests.swift | 2 +- Tests/SwiftModRulesTests/Helpers.swift | 4 +-- 18 files changed, 63 insertions(+), 37 deletions(-) diff --git a/Sources/SwiftModCommands/Arguments.swift b/Sources/SwiftModCommands/Arguments.swift index b59b826..620c642 100644 --- a/Sources/SwiftModCommands/Arguments.swift +++ b/Sources/SwiftModCommands/Arguments.swift @@ -1,13 +1,13 @@ import ArgumentParser import TSCBasic -public enum Mode: String, CaseIterable, ExpressibleByArgument { +public enum Mode: String, CaseIterable, Sendable, ExpressibleByArgument { case modify case dryRun = "dry-run" case check } -extension AbsolutePath: ExpressibleByArgument { +extension AbsolutePath: @retroactive ExpressibleByArgument { public init?(argument: String) { if let cwd = localFileSystem.currentWorkingDirectory { try? self.init(validating: argument, relativeTo: cwd) diff --git a/Sources/SwiftModCommands/Configuration/Configuration+Template.swift b/Sources/SwiftModCommands/Configuration/Configuration+Template.swift index f0c30e0..cd290c0 100644 --- a/Sources/SwiftModCommands/Configuration/Configuration+Template.swift +++ b/Sources/SwiftModCommands/Configuration/Configuration+Template.swift @@ -3,7 +3,7 @@ import SwiftModRules import TSCBasic public extension Configuration { - static let template: Configuration = { + nonisolated(unsafe) static let template: Configuration = { let format = Format( indent: .spaces(4), lineBreakBeforeEachArgument: true diff --git a/Sources/SwiftModCommands/InitCommand.swift b/Sources/SwiftModCommands/InitCommand.swift index 0f2a2db..46dd6e7 100644 --- a/Sources/SwiftModCommands/InitCommand.swift +++ b/Sources/SwiftModCommands/InitCommand.swift @@ -3,7 +3,7 @@ import Foundation import TSCBasic public struct InitCommand: ParsableCommand { - public static var configuration = CommandConfiguration( + public static let configuration = CommandConfiguration( commandName: "init", abstract: "Generates a modify configuration file." ) diff --git a/Sources/SwiftModCommands/RulesCommand.swift b/Sources/SwiftModCommands/RulesCommand.swift index 60e716b..7726ed4 100644 --- a/Sources/SwiftModCommands/RulesCommand.swift +++ b/Sources/SwiftModCommands/RulesCommand.swift @@ -2,7 +2,7 @@ import ArgumentParser import SwiftModCore public struct RulesCommand: ParsableCommand { - public static var configuration = CommandConfiguration( + public static let configuration = CommandConfiguration( commandName: "rules", abstract: "Display the list of rules." ) diff --git a/Sources/SwiftModCommands/RunCommand.swift b/Sources/SwiftModCommands/RunCommand.swift index f38eb73..f3f3d55 100644 --- a/Sources/SwiftModCommands/RunCommand.swift +++ b/Sources/SwiftModCommands/RunCommand.swift @@ -4,7 +4,7 @@ import SwiftModCore import TSCBasic public struct RunCommand: ParsableCommand { - public static var configuration = CommandConfiguration( + public static let configuration = CommandConfiguration( commandName: "run", abstract: "Runs modification." ) diff --git a/Sources/SwiftModCommands/Runners/RunCommandRunner.swift b/Sources/SwiftModCommands/Runners/RunCommandRunner.swift index e0880f4..f11f7ec 100644 --- a/Sources/SwiftModCommands/Runners/RunCommandRunner.swift +++ b/Sources/SwiftModCommands/Runners/RunCommandRunner.swift @@ -5,7 +5,7 @@ import SwiftSyntax import TSCBasic import Yams -internal struct RunCommandRunner { +internal struct RunCommandRunner: @unchecked Sendable { enum Error: Swift.Error, CustomStringConvertible { case readOrParseFileFailed(path: AbsolutePath, error: Swift.Error) case writeFileContentsFailed(path: AbsolutePath, error: Swift.Error) @@ -109,7 +109,7 @@ private extension RunCommandRunner { let modifiedSyntax: Syntax do { - source = try self.fileSystem.readFileContents(path).cString + source = try fileSystem.readFileContents(path).cString syntax = Syntax(Parser.parse(source: source)) modifiedSyntax = pipeline.visit(syntax) } diff --git a/Sources/SwiftModCore/Format.swift b/Sources/SwiftModCore/Format.swift index 91bdb08..d401c10 100644 --- a/Sources/SwiftModCore/Format.swift +++ b/Sources/SwiftModCore/Format.swift @@ -1,4 +1,4 @@ -public struct Format: Codable, Equatable { +public struct Format: Codable, Equatable, Sendable { private enum CodingKeys: String, CodingKey { case indent case lineBreakBeforeEachArgument diff --git a/Sources/SwiftModCore/Helpers/Atomic.swift b/Sources/SwiftModCore/Helpers/Atomic.swift index a5429ed..dda2da4 100644 --- a/Sources/SwiftModCore/Helpers/Atomic.swift +++ b/Sources/SwiftModCore/Helpers/Atomic.swift @@ -1,6 +1,6 @@ import Foundation -public final class Atomic { +public final class Atomic: @unchecked Sendable { public var value: Value { get { modify { $0 } } set { modify { $0 = newValue } } diff --git a/Sources/SwiftModCore/Helpers/InteractiveWriter.swift b/Sources/SwiftModCore/Helpers/InteractiveWriter.swift index 408afc5..23d2abe 100644 --- a/Sources/SwiftModCore/Helpers/InteractiveWriter.swift +++ b/Sources/SwiftModCore/Helpers/InteractiveWriter.swift @@ -1,4 +1,5 @@ import TSCBasic +import TSCLibc public protocol InteractiveWriterProtocol { func write(_ string: String, inColor color: TerminalController.Color, bold: Bool) @@ -10,7 +11,7 @@ public extension InteractiveWriterProtocol { } } -public final class InteractiveWriter: InteractiveWriterProtocol { +public final class InteractiveWriter: InteractiveWriterProtocol, @unchecked Sendable { public static let stdout = InteractiveWriter(stream: stdoutStream) public static let stderr = InteractiveWriter(stream: stderrStream) @@ -33,6 +34,22 @@ public final class InteractiveWriter: InteractiveWriterProtocol { } } +private extension InteractiveWriter { + nonisolated(unsafe) static var stdoutStream: ThreadSafeOutputByteStream = try! ThreadSafeOutputByteStream( + LocalFileOutputByteStream( + filePointer: TSCLibc.stdout, + closeOnDeinit: false + ) + ) + + nonisolated(unsafe) static var stderrStream: ThreadSafeOutputByteStream = try! ThreadSafeOutputByteStream( + LocalFileOutputByteStream( + filePointer: TSCLibc.stderr, + closeOnDeinit: false + ) + ) +} + public final class InMemoryInteractiveWriter: InteractiveWriterProtocol { public struct Input: Equatable { public let string: String diff --git a/Sources/SwiftModCore/Helpers/RulePipeline.swift b/Sources/SwiftModCore/Helpers/RulePipeline.swift index 40ad1c6..5ff4970 100644 --- a/Sources/SwiftModCore/Helpers/RulePipeline.swift +++ b/Sources/SwiftModCore/Helpers/RulePipeline.swift @@ -1,6 +1,6 @@ import SwiftSyntax -public struct RulePipeline { +public struct RulePipeline: @unchecked Sendable { private let rules: ContiguousArray public init(_ rules: S) where S.Element == Rule { diff --git a/Sources/SwiftModCore/Indent.swift b/Sources/SwiftModCore/Indent.swift index 6b3af55..80ebd3b 100644 --- a/Sources/SwiftModCore/Indent.swift +++ b/Sources/SwiftModCore/Indent.swift @@ -1,4 +1,4 @@ -public enum Indent: Codable, Equatable { +public enum Indent: Codable, Equatable, Sendable { case spaces(Int) case tab diff --git a/Sources/SwiftModCore/RuleDescription.swift b/Sources/SwiftModCore/RuleDescription.swift index fe338d3..1ae22ff 100644 --- a/Sources/SwiftModCore/RuleDescription.swift +++ b/Sources/SwiftModCore/RuleDescription.swift @@ -1,12 +1,12 @@ -public struct RuleDescription { +public struct RuleDescription: Sendable { public var name: String public var priority: RulePriority public var overview: String - public var exampleOptions: DynamicEncodable + nonisolated(unsafe) public var exampleOptions: DynamicEncodable public var exampleBefore: String public var exampleAfter: String - public init( + public init( name: String, priority: RulePriority, overview: String, @@ -17,7 +17,11 @@ public struct RuleDescription { self.name = name self.priority = priority self.overview = overview - self.exampleOptions = DynamicEncodable(encode: exampleOptions.encode) + self.exampleOptions = DynamicEncodable( + encode: { encoder in + try exampleOptions.encode(to: encoder) + } + ) self.exampleBefore = exampleBefore self.exampleAfter = exampleAfter } diff --git a/Sources/SwiftModCore/RulePriority.swift b/Sources/SwiftModCore/RulePriority.swift index 283318b..ff5b64d 100644 --- a/Sources/SwiftModCore/RulePriority.swift +++ b/Sources/SwiftModCore/RulePriority.swift @@ -1,4 +1,4 @@ -public struct RulePriority: RawRepresentable, Comparable { +public struct RulePriority: RawRepresentable, Comparable, Sendable { public var rawValue: Int public static let high = RulePriority(rawValue: 1000) diff --git a/Sources/SwiftModRules/DefaultAccessLevelRule.swift b/Sources/SwiftModRules/DefaultAccessLevelRule.swift index 3098a7e..f6050cf 100644 --- a/Sources/SwiftModRules/DefaultAccessLevelRule.swift +++ b/Sources/SwiftModRules/DefaultAccessLevelRule.swift @@ -42,7 +42,7 @@ public final class DefaultAccessLevelRule: RuleDefinition { """ ) - public enum AccessLebel: String, Codable { + public enum AccessLebel: String, Codable, Sendable { case openOrPublic case `public` case `internal` @@ -50,7 +50,7 @@ public final class DefaultAccessLevelRule: RuleDefinition { case `private` } - public struct Options: Codable { + public struct Options: Codable, Sendable { public var accessLevel: AccessLebel public var implicitInternal: Bool? diff --git a/Sources/SwiftModRules/DefaultMemberwiseInitializerRule.swift b/Sources/SwiftModRules/DefaultMemberwiseInitializerRule.swift index ead62c8..6485439 100644 --- a/Sources/SwiftModRules/DefaultMemberwiseInitializerRule.swift +++ b/Sources/SwiftModRules/DefaultMemberwiseInitializerRule.swift @@ -51,7 +51,7 @@ public final class DefaultMemberwiseInitializerRule: RuleDefinition { """ ) - public struct Options: Codable { + public struct Options: Codable, Sendable { public var implicitInitializer: Bool? public var implicitInternal: Bool? public var ignoreClassesWithInheritance: Bool? @@ -327,19 +327,24 @@ private extension TypeSyntax { func attributed() -> TypeSyntax { if self.is(FunctionTypeSyntax.self) { - return TypeSyntax( - AttributedTypeSyntax( - attributes: AttributeListSyntax([ - .attribute( - AttributeSyntax( - atSign: .atSignToken(), - attributeName: IdentifierTypeSyntax(name: .identifier("escaping")) - .with(\.trailingTrivia, .space) - ) - ) - ]), - baseType: self + let attributes = AttributeListSyntax([ + .attribute( + AttributeSyntax( + atSign: .atSignToken(), + attributeName: IdentifierTypeSyntax(name: .identifier("escaping")) + .with(\.trailingTrivia, .space) + ) ) + ]) + let typeSyntax = AttributedTypeSyntax( + leadingTrivia: nil, + specifiers: [], + attributes: attributes, + baseType: self, + trailingTrivia: nil + ) + return TypeSyntax( + typeSyntax ) } else { diff --git a/Sources/swift-mod/SwiftMod.swift b/Sources/swift-mod/SwiftMod.swift index f3da490..90a93a6 100644 --- a/Sources/swift-mod/SwiftMod.swift +++ b/Sources/swift-mod/SwiftMod.swift @@ -3,7 +3,7 @@ import SwiftModCommands @main struct SwiftMod: ParsableCommand { - static var configuration = CommandConfiguration( + static let configuration = CommandConfiguration( commandName: "swift-mod", abstract: "Modifies Swift source code with rules", subcommands: [ diff --git a/Tests/SwiftModCommandsTests/Configuration+CodableTests.swift b/Tests/SwiftModCommandsTests/Configuration+CodableTests.swift index 37b7c7a..f78273a 100644 --- a/Tests/SwiftModCommandsTests/Configuration+CodableTests.swift +++ b/Tests/SwiftModCommandsTests/Configuration+CodableTests.swift @@ -3,7 +3,7 @@ import SwiftModCore import XCTest import Yams -func assertConfigurationCoding(_ configuration: Configuration, file: StaticString = #file, line: UInt = #line) { +func assertConfigurationCoding(_ configuration: Configuration, file: StaticString = #filePath, line: UInt = #line) { do { let encoded = try YAMLEncoder().encode(configuration) let decoded = try YAMLDecoder().decode(Configuration.self, from: encoded) diff --git a/Tests/SwiftModRulesTests/Helpers.swift b/Tests/SwiftModRulesTests/Helpers.swift index 8ec47f7..7992beb 100644 --- a/Tests/SwiftModRulesTests/Helpers.swift +++ b/Tests/SwiftModRulesTests/Helpers.swift @@ -3,7 +3,7 @@ import SwiftModCore import SwiftParser import XCTest -func assertRuleDescription(_ rule: AnyRule, file: StaticString = #file, line: UInt = #line) throws { +func assertRuleDescription(_ rule: AnyRule, file: StaticString = #filePath, line: UInt = #line) throws { let description = type(of: rule).description let encodedOptions = try? JSONEncoder().encode(description.exampleOptions) let exampleSyntax = Parser.parse(source: description.exampleBefore) @@ -15,7 +15,7 @@ func assertRuleDescription(_ rule: AnyRule, file: StaticString = #file, line: UI XCTAssertEqual(exampleModified, description.exampleAfter, file: file, line: line) } -func assertRule(_ rule: AnyRule, source: String, expected: String, file: StaticString = #file, line: UInt = #line) throws { +func assertRule(_ rule: AnyRule, source: String, expected: String, file: StaticString = #filePath, line: UInt = #line) throws { let syntax = Parser.parse(source: source) let modified = rule.rewriter().visit(syntax).description XCTAssertEqual(modified, expected, file: file, line: line) From ab7269043f1056b7159a7d07dc79a4a772b65781 Mon Sep 17 00:00:00 2001 From: Ras Date: Thu, 19 Jun 2025 13:02:54 +0900 Subject: [PATCH 3/7] Update configurations and readme --- .github/workflows/publish.yml | 4 ++-- .github/workflows/test.yml | 6 +++--- Makefile | 2 +- README.md | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 88a3ffb..b4df336 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,11 +6,11 @@ on: jobs: publish: name: Publish - runs-on: macos-14 + runs-on: macos-15 strategy: matrix: xcode_version: - - "15.4" + - "16.4" env: DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 835513a..0abfe90 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: name: Test on Linux runs-on: ubuntu-22.04 container: - image: swift:5.10 + image: swift:6.1 steps: - uses: actions/checkout@v2 - name: Show Environments @@ -26,11 +26,11 @@ jobs: run: make test macOS: name: Test on macOS - runs-on: macos-14 + runs-on: macos-15 strategy: matrix: xcode_version: - - "15.4" + - "16.4" env: DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app steps: diff --git a/Makefile b/Makefile index 6d6529e..fc1da65 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ SWIFT_BUILD_FLAGS := -c release --disable-sandbox TOOL_NAME := swift-mod XCODE_DEFAULT_TOOLCHAIN := /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain GITHUB_REPO := ra1028/$(TOOL_NAME) -DOCKER_IMAGE_NAME := swift:5.10 +DOCKER_IMAGE_NAME := swift:6.1 ifeq ($(shell uname), Darwin) SWIFT_BUILD_FLAGS += --arch arm64 --arch x86_64 diff --git a/README.md b/README.md index b3cfa2b..241860a 100644 --- a/README.md +++ b/README.md @@ -316,6 +316,7 @@ So you should use swift-mod version that built with compatible version of Swift |5.8 |0.2.0 | |5.9 |0.2.0 | |5.10 |0.2.1 | +|6.1 |0.3.0 | --- From 69fc2975c33258af2f6834d611c8cd8cac0f0081 Mon Sep 17 00:00:00 2001 From: Ras Date: Thu, 19 Jun 2025 13:13:49 +0900 Subject: [PATCH 4/7] Revert collapsed call --- .../DefaultMemberwiseInitializerRule.swift | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/Sources/SwiftModRules/DefaultMemberwiseInitializerRule.swift b/Sources/SwiftModRules/DefaultMemberwiseInitializerRule.swift index 6485439..165d491 100644 --- a/Sources/SwiftModRules/DefaultMemberwiseInitializerRule.swift +++ b/Sources/SwiftModRules/DefaultMemberwiseInitializerRule.swift @@ -327,24 +327,22 @@ private extension TypeSyntax { func attributed() -> TypeSyntax { if self.is(FunctionTypeSyntax.self) { - let attributes = AttributeListSyntax([ - .attribute( - AttributeSyntax( - atSign: .atSignToken(), - attributeName: IdentifierTypeSyntax(name: .identifier("escaping")) - .with(\.trailingTrivia, .space) - ) - ) - ]) - let typeSyntax = AttributedTypeSyntax( - leadingTrivia: nil, - specifiers: [], - attributes: attributes, - baseType: self, - trailingTrivia: nil - ) return TypeSyntax( - typeSyntax + AttributedTypeSyntax( + leadingTrivia: nil, + specifiers: [], + attributes: AttributeListSyntax([ + .attribute( + AttributeSyntax( + atSign: .atSignToken(), + attributeName: IdentifierTypeSyntax(name: .identifier("escaping")) + .with(\.trailingTrivia, .space) + ) + ) + ]), + baseType: self, + trailingTrivia: nil + ) ) } else { From 641e7bdb866318eadc5bbd9bdaf3070fa63ac242 Mon Sep 17 00:00:00 2001 From: Ras Date: Wed, 27 Aug 2025 17:16:03 +0900 Subject: [PATCH 5/7] Empty commit to trigger CI From 3d4ad92ad5b4b081a0e95a87ad1e52ce11ef5ad1 Mon Sep 17 00:00:00 2001 From: Ras Date: Mon, 20 Oct 2025 13:32:17 +0900 Subject: [PATCH 6/7] Attempt to fix linux concurrenyc failure --- .../Helpers/InteractiveWriter.swift | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Sources/SwiftModCore/Helpers/InteractiveWriter.swift b/Sources/SwiftModCore/Helpers/InteractiveWriter.swift index 23d2abe..cdd695d 100644 --- a/Sources/SwiftModCore/Helpers/InteractiveWriter.swift +++ b/Sources/SwiftModCore/Helpers/InteractiveWriter.swift @@ -35,19 +35,23 @@ public final class InteractiveWriter: InteractiveWriterProtocol, @unchecked Send } private extension InteractiveWriter { - nonisolated(unsafe) static var stdoutStream: ThreadSafeOutputByteStream = try! ThreadSafeOutputByteStream( - LocalFileOutputByteStream( - filePointer: TSCLibc.stdout, - closeOnDeinit: false + nonisolated(unsafe) static var stdoutStream: ThreadSafeOutputByteStream { + try! ThreadSafeOutputByteStream( + LocalFileOutputByteStream( + filePointer: TSCLibc.stdout, + closeOnDeinit: false + ) ) - ) + } - nonisolated(unsafe) static var stderrStream: ThreadSafeOutputByteStream = try! ThreadSafeOutputByteStream( - LocalFileOutputByteStream( - filePointer: TSCLibc.stderr, - closeOnDeinit: false + nonisolated(unsafe) static var stderrStream: ThreadSafeOutputByteStream { + try! ThreadSafeOutputByteStream( + LocalFileOutputByteStream( + filePointer: TSCLibc.stderr, + closeOnDeinit: false + ) ) - ) + } } public final class InMemoryInteractiveWriter: InteractiveWriterProtocol { From ba21c1f1f56a256b01321667b0f3615f27d70fcc Mon Sep 17 00:00:00 2001 From: Ras Date: Mon, 20 Oct 2025 13:41:04 +0900 Subject: [PATCH 7/7] Attempt to fix linux concurrenyc failure 2 --- Sources/SwiftModCore/Helpers/InteractiveWriter.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SwiftModCore/Helpers/InteractiveWriter.swift b/Sources/SwiftModCore/Helpers/InteractiveWriter.swift index cdd695d..bfe54c9 100644 --- a/Sources/SwiftModCore/Helpers/InteractiveWriter.swift +++ b/Sources/SwiftModCore/Helpers/InteractiveWriter.swift @@ -1,5 +1,5 @@ import TSCBasic -import TSCLibc +@preconcurrency import TSCLibc public protocol InteractiveWriterProtocol { func write(_ string: String, inColor color: TerminalController.Color, bold: Bool)