Skip to content

Commit

Permalink
Disable parameter count linting rule and remove inout
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaosCoder committed Feb 17, 2019
1 parent 895ae5a commit 3370189
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion Sources/Danger-Swift/Fake.swift
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

12 changes: 8 additions & 4 deletions Sources/Danger/Plugins/SwiftLint/SwiftLint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ extension SwiftLint {
if lintAllFiles {
// Allow folks to lint all the potential files
violations = lintAll(directory: directory,
arguments: &arguments,
arguments: arguments,
shellExecutor: shellExecutor,
swiftlintPath: swiftlintPath,
failAction: failAction)
} else {
violations = lintModifiedAndCreated(danger: danger,
directory: directory,
arguments: &arguments,
arguments: arguments,
shellExecutor: shellExecutor,
swiftlintPath: swiftlintPath,
failAction: failAction)
Expand Down Expand Up @@ -110,10 +110,12 @@ extension SwiftLint {
}

private static func lintAll(directory: String?,
arguments: inout [String],
arguments: [String],
shellExecutor: ShellExecutor,
swiftlintPath: String,
failAction: (String) -> Void) -> [SwiftLintViolation] {
var arguments = arguments

if let directory = directory {
arguments.append("--path \"\(directory)\"")
}
Expand All @@ -122,9 +124,10 @@ extension SwiftLint {
return makeViolations(from: outputJSON, failAction: failAction)
}

// swiftlint:disable function_parameter_count
private static func lintModifiedAndCreated(danger: DangerDSL,
directory: String?,
arguments: inout [String],
arguments: [String],
shellExecutor: ShellExecutor,
swiftlintPath: String,
failAction: (String) -> Void) -> [SwiftLintViolation] {
Expand All @@ -139,6 +142,7 @@ extension SwiftLint {
return []
}

var arguments = arguments
arguments.append("--use-script-input-files")
arguments.append("--force-exclude")

Expand Down

0 comments on commit 3370189

Please sign in to comment.