From fd7afedfcfe73443a95041fdc51c31d071b97910 Mon Sep 17 00:00:00 2001 From: JP Simard Date: Mon, 26 Sep 2022 10:11:39 -0400 Subject: [PATCH] Update SwiftSyntax & internal parser for Swift 5.7 (#4203) Require Swift 5.7 to compile --- CHANGELOG.md | 7 +++++++ Package.resolved | 8 ++++---- Package.swift | 6 +++--- azure-pipelines.yml | 26 +++++++++++++------------- bazel/repos.bzl | 6 +++--- 5 files changed, 30 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a89a6f51a..daf9d1ae1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ #### Breaking +* SwiftLint now requires Swift 5.7 or higher to build. + [JP Simard](https://github.com/jpsim) + * Exclude `weak_delegate` rule from autocorrection due to behavioral changes leading to potential undefined behavior or bugs. [SimplyDanny](https://github.com/SimplyDanny) @@ -75,6 +78,10 @@ [SimplyDanny](https://github.com/SimplyDanny) [#4202](https://github.com/realm/SwiftLint/issues/4202) +* SwiftSyntax libraries were updated to their 5.7 releases, improving how newer + Swift language features are handled. + [JP Simard](https://github.com/jpims) + #### Bug Fixes * Respect `validates_start_with_lowercase` option when linting function names. diff --git a/Package.resolved b/Package.resolved index 0d843f46d..307b19ec9 100644 --- a/Package.resolved +++ b/Package.resolved @@ -24,8 +24,8 @@ "repositoryURL": "https://github.com/apple/swift-argument-parser.git", "state": { "branch": null, - "revision": "df9ee6676cd5b3bf5b330ec7568a5644f547201b", - "version": "1.1.3" + "revision": "9f39744e025c7d377987f30b03770805dcb0bcd1", + "version": "1.1.4" } }, { @@ -33,8 +33,8 @@ "repositoryURL": "https://github.com/apple/swift-syntax.git", "state": { "branch": null, - "revision": "0b6c22b97f8e9320bca62e82cdbee601cf37ad3f", - "version": "0.50600.1" + "revision": "04d4497be6b88e524a71778d828790e9589ae1c4", + "version": "0.50700.0" } }, { diff --git a/Package.swift b/Package.swift index b25410790..6e3a9d992 100644 --- a/Package.swift +++ b/Package.swift @@ -28,7 +28,7 @@ let package = Package( ], dependencies: [ .package(name: "swift-argument-parser", url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "1.1.3")), - .package(name: "SwiftSyntax", url: "https://github.com/apple/swift-syntax.git", .exact("0.50600.1")), + .package(name: "SwiftSyntax", url: "https://github.com/apple/swift-syntax.git", .exact("0.50700.0")), .package(url: "https://github.com/jpsim/SourceKitten.git", from: "0.33.0"), .package(url: "https://github.com/jpsim/Yams.git", from: "5.0.1"), .package(url: "https://github.com/scottrhoyt/SwiftyTextTable.git", from: "0.9.0"), @@ -63,7 +63,7 @@ let package = Package( ), ] + (staticSwiftSyntax ? [.binaryTarget( name: "lib_InternalSwiftSyntaxParser", - url: "https://github.com/keith/StaticInternalSwiftSyntaxParser/releases/download/5.6/lib_InternalSwiftSyntaxParser.xcframework.zip", - checksum: "88d748f76ec45880a8250438bd68e5d6ba716c8042f520998a438db87083ae9d" + url: "https://github.com/keith/StaticInternalSwiftSyntaxParser/releases/download/5.7/lib_InternalSwiftSyntaxParser.xcframework.zip", + checksum: "99803975d10b2664fc37cc223a39b4e37fe3c79d3d6a2c44432007206d49db15" )] : []) ) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d10475f06..e4083e712 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -19,8 +19,8 @@ jobs: strategy: maxParallel: 10 matrix: - swift56: - containerImage: swift:5.6 + swift57: + containerImage: swift:5.7 container: $[ variables['containerImage'] ] steps: - script: swift test --parallel -Xswiftc -DDISABLE_FOCUSED_EXAMPLES @@ -32,8 +32,8 @@ jobs: strategy: maxParallel: 10 matrix: - xcode1341: - DEVELOPER_DIR: /Applications/Xcode_13.4.1.app + xcode14: + DEVELOPER_DIR: /Applications/Xcode_14.0.1.app steps: - script: | sw_vers @@ -48,8 +48,8 @@ jobs: strategy: maxParallel: 10 matrix: - xcode1341: - DEVELOPER_DIR: /Applications/Xcode_13.4.1.app + xcode14: + DEVELOPER_DIR: /Applications/Xcode_14.0.1.app steps: - script: | sw_vers @@ -57,11 +57,11 @@ jobs: displayName: Version Informations - script: swift test --parallel --enable-code-coverage -Xswiftc -DDISABLE_FOCUSED_EXAMPLES displayName: swift test - - script: | - xcrun llvm-cov export -format="lcov" .build/debug/SwiftLintPackageTests.xctest/Contents/MacOS/SwiftLintPackageTests -instr-profile .build/debug/codecov/default.profdata > coverage.lcov - bash <(curl -s https://codecov.io/bash) - displayName: Upload code coverage - condition: eq(variables['DEVELOPER_DIR'], '/Applications/Xcode_13.2.1.app') + # - script: | + # xcrun llvm-cov export -format="lcov" .build/debug/SwiftLintPackageTests.xctest/Contents/MacOS/SwiftLintPackageTests -instr-profile .build/debug/codecov/default.profdata > coverage.lcov + # bash <(curl -s https://codecov.io/bash) + # displayName: Upload code coverage + # condition: eq(variables['DEVELOPER_DIR'], '/Applications/Xcode_14.0.1.app') - job: CocoaPods pool: @@ -80,7 +80,7 @@ jobs: pool: vmImage: 'macOS-12' variables: - DEVELOPER_DIR: /Applications/Xcode_13.3.1.app + DEVELOPER_DIR: /Applications/Xcode_14.0.1.app steps: - script: | curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.12.2/bazelisk-darwin-amd64 -o bazelisk @@ -101,7 +101,7 @@ jobs: pool: vmImage: 'macOS-12' variables: - DEVELOPER_DIR: /Applications/Xcode_13.4.1.app + DEVELOPER_DIR: /Applications/Xcode_14.0.1.app steps: - script: swift run swiftlint generate-docs displayName: Run swiftlint generate-docs diff --git a/bazel/repos.bzl b/bazel/repos.bzl index 05990eb48..86c342c65 100644 --- a/bazel/repos.bzl +++ b/bazel/repos.bzl @@ -19,9 +19,9 @@ def swiftlint_repos(): http_archive( name = "com_github_keith_swift_syntax_bazel", - sha256 = "f83b8449f84e29d263d2b0ceb9d2ae7f88c9f2a81f4b10035e94073664507507", - strip_prefix = "swift-syntax-bazel-13.3.13E113", - url = "https://github.com/keith/swift-syntax-bazel/archive/refs/tags/13.3.13E113.tar.gz", + sha256 = "ca7f3a8099e4e7a454f45abea1ededabe209d9f6964df87566a142e3b281fe24", + strip_prefix = "swift-syntax-bazel-14.0.0.14A309", + url = "https://github.com/keith/swift-syntax-bazel/archive/refs/tags/14.0.0.14A309.tar.gz", ) http_archive(