Skip to content

Commit e4e7167

Browse files
authored
Merge branch 'master' into jflan/pipe-overfill
2 parents 2152706 + 8f0bf9d commit e4e7167

File tree

7 files changed

+156
-33
lines changed

7 files changed

+156
-33
lines changed

CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@
1515

1616
- Drain stdout while shell commands are running to prevent execution from locking up if there's too much output [@jflan-dd][] - [#614](https://github.com/danger/swift/pull/614)
1717

18+
## 3.20.0
19+
- Remove deprecated `lint` function with `lintAllFiles` flag [@417-72KI][] - [#622](https://github.com/danger/swift/pull/622)
20+
- Updated Swift 6 build process: Danger files moved to .build/debug/Modules, and SwiftFormat module map conflict resolved by adjusting the Swift import search path. [@abhi-m-simformsolutons][] -[#626](https://github.com/danger/swift/pull/626)
21+
1822
## 3.19.1
1923

20-
- Expose markdownKit on Swiftlint.lint() for customizing the output [@nikoloutsos][] - [#609](https://github.com/danger/swift/pull/609)
24+
- Expose markdownKit on Swiftlint.lint() for customizing the output [@nikoloutsos][] - [#610](https://github.com/danger/swift/pull/610)
2125
- Drop Swift 5.7 [@417-72KI][] - [#620](https://github.com/danger/swift/pull/620)
2226
- Fix pattern for detecting SwiftLint in package [@417-72KI][] - [#616](https://github.com/danger/swift/pull/616)
2327
- Allow optional GitLab MR description [@kvvzr][] - [#609](https://github.com/danger/swift/pull/609)

Package.resolved

+135
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
{
22
"pins" : [
3+
{
4+
"identity" : "collectionconcurrencykit",
5+
"kind" : "remoteSourceControl",
6+
"location" : "https://github.com/JohnSundell/CollectionConcurrencyKit.git",
7+
"state" : {
8+
"revision" : "b4f23e24b5a1bff301efc5e70871083ca029ff95",
9+
"version" : "0.2.0"
10+
}
11+
},
12+
{
13+
"identity" : "cryptoswift",
14+
"kind" : "remoteSourceControl",
15+
"location" : "https://github.com/krzyzanowskim/CryptoSwift.git",
16+
"state" : {
17+
"revision" : "678d442c6f7828def400a70ae15968aef67ef52d",
18+
"version" : "1.8.3"
19+
}
20+
},
21+
{
22+
"identity" : "komondor",
23+
"kind" : "remoteSourceControl",
24+
"location" : "https://github.com/shibapm/Komondor",
25+
"state" : {
26+
"revision" : "dedffeaf42a1b52bf072a9dc47afb35000a8b265",
27+
"version" : "1.1.4"
28+
}
29+
},
330
{
431
"identity" : "logger",
532
"kind" : "remoteSourceControl",
@@ -18,6 +45,15 @@
1845
"version" : "0.13.0"
1946
}
2047
},
48+
{
49+
"identity" : "packageconfig",
50+
"kind" : "remoteSourceControl",
51+
"location" : "https://github.com/shibapm/PackageConfig.git",
52+
"state" : {
53+
"revision" : "58523193c26fb821ed1720dcd8a21009055c7cdb",
54+
"version" : "1.1.3"
55+
}
56+
},
2157
{
2258
"identity" : "requestkit",
2359
"kind" : "remoteSourceControl",
@@ -27,6 +63,60 @@
2763
"version" : "3.3.0"
2864
}
2965
},
66+
{
67+
"identity" : "rocket",
68+
"kind" : "remoteSourceControl",
69+
"location" : "https://github.com/shibapm/Rocket",
70+
"state" : {
71+
"revision" : "32af356776108ee7289884874a0eb63ceacb9e5d",
72+
"version" : "1.3.0"
73+
}
74+
},
75+
{
76+
"identity" : "shellout",
77+
"kind" : "remoteSourceControl",
78+
"location" : "https://github.com/JohnSundell/ShellOut.git",
79+
"state" : {
80+
"revision" : "e1577acf2b6e90086d01a6d5e2b8efdaae033568",
81+
"version" : "2.3.0"
82+
}
83+
},
84+
{
85+
"identity" : "sourcekitten",
86+
"kind" : "remoteSourceControl",
87+
"location" : "https://github.com/jpsim/SourceKitten.git",
88+
"state" : {
89+
"revision" : "fd4df99170f5e9d7cf9aa8312aa8506e0e7a44e7",
90+
"version" : "0.35.0"
91+
}
92+
},
93+
{
94+
"identity" : "swift-argument-parser",
95+
"kind" : "remoteSourceControl",
96+
"location" : "https://github.com/apple/swift-argument-parser.git",
97+
"state" : {
98+
"revision" : "41982a3656a71c768319979febd796c6fd111d5c",
99+
"version" : "1.5.0"
100+
}
101+
},
102+
{
103+
"identity" : "swift-snapshot-testing",
104+
"kind" : "remoteSourceControl",
105+
"location" : "https://github.com/pointfreeco/swift-snapshot-testing.git",
106+
"state" : {
107+
"revision" : "7b0bbbae90c41f848f90ac7b4df6c4f50068256d",
108+
"version" : "1.17.5"
109+
}
110+
},
111+
{
112+
"identity" : "swift-syntax",
113+
"kind" : "remoteSourceControl",
114+
"location" : "https://github.com/swiftlang/swift-syntax",
115+
"state" : {
116+
"revision" : "515f79b522918f83483068d99c68daeb5116342d",
117+
"version" : "600.0.0-prerelease-2024-08-14"
118+
}
119+
},
30120
{
31121
"identity" : "swiftformat",
32122
"kind" : "remoteSourceControl",
@@ -36,6 +126,42 @@
36126
"version" : "0.54.3"
37127
}
38128
},
129+
{
130+
"identity" : "swiftlint",
131+
"kind" : "remoteSourceControl",
132+
"location" : "https://github.com/Realm/SwiftLint",
133+
"state" : {
134+
"revision" : "168fb98ed1f3e343d703ecceaf518b6cf565207b",
135+
"version" : "0.57.0"
136+
}
137+
},
138+
{
139+
"identity" : "swiftshell",
140+
"kind" : "remoteSourceControl",
141+
"location" : "https://github.com/kareman/SwiftShell",
142+
"state" : {
143+
"revision" : "99680b2efc7c7dbcace1da0b3979d266f02e213c",
144+
"version" : "5.1.0"
145+
}
146+
},
147+
{
148+
"identity" : "swiftytexttable",
149+
"kind" : "remoteSourceControl",
150+
"location" : "https://github.com/scottrhoyt/SwiftyTextTable.git",
151+
"state" : {
152+
"revision" : "c6df6cf533d120716bff38f8ff9885e1ce2a4ac3",
153+
"version" : "0.9.0"
154+
}
155+
},
156+
{
157+
"identity" : "swxmlhash",
158+
"kind" : "remoteSourceControl",
159+
"location" : "https://github.com/drmohundro/SWXMLHash.git",
160+
"state" : {
161+
"revision" : "a853604c9e9a83ad9954c7e3d2a565273982471f",
162+
"version" : "7.0.2"
163+
}
164+
},
39165
{
40166
"identity" : "version",
41167
"kind" : "remoteSourceControl",
@@ -44,6 +170,15 @@
44170
"revision" : "1fe824b80d89201652e7eca7c9252269a1d85e25",
45171
"version" : "2.0.1"
46172
}
173+
},
174+
{
175+
"identity" : "yams",
176+
"kind" : "remoteSourceControl",
177+
"location" : "https://github.com/jpsim/Yams",
178+
"state" : {
179+
"revision" : "3036ba9d69cf1fd04d433527bc339dc0dc75433d",
180+
"version" : "5.1.3"
181+
}
47182
}
48183
],
49184
"version" : 2

Sources/Danger/Plugins/SwiftLint/SwiftLint.swift

+5-29
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,6 @@ public enum SwiftLint {
3737
static let danger = Danger()
3838
static let shellExecutor = ShellExecutor()
3939

40-
/// This method is deprecated in favor of
41-
@available(*, deprecated, message: "Use the lint(_ lintStyle ..) method instead.")
42-
@discardableResult
43-
public static func lint(inline: Bool = false,
44-
directory: String? = nil,
45-
configFile: String? = nil,
46-
strict: Bool = false,
47-
quiet: Bool = true,
48-
lintAllFiles: Bool = false,
49-
swiftlintPath: String? = nil) -> [SwiftLintViolation] {
50-
let lintStyle: LintStyle = {
51-
if lintAllFiles {
52-
return .all(directory: directory)
53-
} else {
54-
return .modifiedAndCreatedFiles(directory: directory)
55-
}
56-
}()
57-
58-
return lint(lintStyle,
59-
inline: inline,
60-
configFile: configFile,
61-
strict: strict,
62-
quiet: quiet,
63-
swiftlintPath: swiftlintPath)
64-
}
65-
6640
/// When the swiftlintPath is not specified,
6741
/// it uses by default swift run swiftlint if the Package.swift in your root folder contains swiftlint as dependency,
6842
/// otherwise calls directly the swiftlint command
@@ -73,13 +47,15 @@ public enum SwiftLint {
7347
configFile: String? = nil,
7448
strict: Bool = false,
7549
quiet: Bool = true,
76-
swiftlintPath: String?) -> [SwiftLintViolation] {
50+
swiftlintPath: String,
51+
markdownAction: (String) -> Void = markdown) -> [SwiftLintViolation] {
7752
lint(lintStyle,
7853
inline: inline,
7954
configFile: configFile,
8055
strict: strict,
8156
quiet: quiet,
82-
swiftlintPath: swiftlintPath.map(SwiftlintPath.bin))
57+
swiftlintPath: .bin(swiftlintPath),
58+
markdownAction: markdownAction)
8359
}
8460

8561
/// This is the main entry point for linting Swift in PRs.
@@ -209,7 +185,7 @@ extension SwiftLint {
209185
var arguments = arguments
210186

211187
if let directory = directory {
212-
arguments.append("--path \"\(directory)\"")
188+
arguments.append(directory)
213189
}
214190

215191
return swiftlintViolations(swiftlintPath: swiftlintPath,

Sources/Runner/Commands/Runner.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func runDanger(version dangerSwiftVersion: String, logger: Logger) throws {
6060
if let spmDanger = SPMDanger() {
6161
spmDanger.buildDependencies(executor: executor)
6262
libArgs += ["-L", spmDanger.buildFolder]
63-
libArgs += ["-I", spmDanger.buildFolder]
63+
libArgs += ["-I", spmDanger.moduleFolder]
6464
libArgs += [spmDanger.swiftcLibImport]
6565
} else {
6666
guard let libDangerPath = Runtime.getLibDangerPath() else {

Sources/Runner/main.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Logger
33
import RunnerLib
44

55
/// Version for showing in verbose mode
6-
let DangerVersion = "3.19.1" // swiftlint:disable:this identifier_name
6+
let DangerVersion = "3.20.0" // swiftlint:disable:this identifier_name
77
let MinimumDangerJSVersion = "6.1.6" // swiftlint:disable:this identifier_name
88

99
private func runCommand(_ command: DangerCommand, logger: Logger) throws {

Sources/RunnerLib/SPMDanger.swift

+8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ public struct SPMDanger {
1010
fileManager.currentDirectoryPath + "/.build/debug"
1111
}
1212

13+
public var moduleFolder: String {
14+
#if compiler(<6.0)
15+
buildFolder
16+
#else
17+
buildFolder + "/Modules"
18+
#endif
19+
}
20+
1321
public init?(
1422
packagePath: String = "Package.swift",
1523
readFile: (String) -> String? = { try? String(contentsOfFile: $0) },

Tests/DangerTests/SwiftLint/DangerSwiftLintTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ final class DangerSwiftLintTests: XCTestCase {
268268
XCTAssertNotNil(swiftlintCommand)
269269
XCTAssertEqual(swiftlintCommand!.environmentVariables.count, 0)
270270
XCTAssertFalse(swiftlintCommand!.environmentVariables.values.contains { $0.contains("Tests/SomeFile.swift") })
271-
XCTAssertTrue(swiftlintCommand!.arguments.contains("--path \"Tests\""))
271+
XCTAssertEqual(swiftlintCommand!.arguments.last, directory)
272272
}
273273

274274
func testFiltersOnSwiftFiles() {

0 commit comments

Comments
 (0)