Skip to content

Commit a3c659e

Browse files
authored
Merge pull request #622 from 417-72KI/fix-ambiguous-use-of-lint
2 parents 164c4d2 + 1e29186 commit a3c659e

File tree

2 files changed

+6
-29
lines changed

2 files changed

+6
-29
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
-->
1313

1414
## Master
15+
- Remove deprecated `lint` function with `lintAllFiles` flag [@417-72KI][] - [#622](https://github.com/danger/swift/pull/622)
1516

1617
## 3.19.1
1718

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

Sources/Danger/Plugins/SwiftLint/SwiftLint.swift

Lines changed: 4 additions & 28 deletions
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.

0 commit comments

Comments
 (0)