Skip to content

Commit

Permalink
Pass only remaining arguments to swiftlint command (#5865)
Browse files Browse the repository at this point in the history
Missing part of 7904d9a.
  • Loading branch information
SimplyDanny authored Nov 19, 2024
1 parent 086f1b3 commit c784adc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Plugins/SwiftLintCommandPlugin/SwiftLintCommandPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ struct SwiftLintCommandPlugin: CommandPlugin {
let targets = targetNames.isEmpty
? context.package.targets
: try context.package.targets(named: targetNames)
if targets.isEmpty || !commandsNotExpectingPaths.isDisjoint(with: arguments) {
try run(with: context, arguments: arguments)
let remainingArguments = argExtractor.remainingArguments
if targets.isEmpty || !commandsNotExpectingPaths.isDisjoint(with: remainingArguments) {
try run(with: context, arguments: remainingArguments)
return
}
for target in targets {
guard let target = target.sourceModule else {
Diagnostics.warning("Target '\(target.name)' is not a source module; skipping it")
continue
}
try run(in: target.directory.string, for: target.name, with: context, arguments: arguments)
try run(in: target.directory.string, for: target.name, with: context, arguments: remainingArguments)
}
}

Expand Down

0 comments on commit c784adc

Please sign in to comment.