Skip to content

Commit 4bb5728

Browse files
authored
Merge pull request #608 from BrianHenryIE/default-all-targets-fix-483
Default to all targets when plugin `--target` parameter missing. Fix #483
2 parents 23cbb8e + b21d330 commit 4bb5728

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Plugins/FormatPlugin/plugin.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ extension FormatPlugin: CommandPlugin {
3838

3939
var argExtractor = ArgumentExtractor(arguments)
4040
let targetNames = argExtractor.extractOption(named: "target")
41-
let targetsToFormat = try context.package.targets(named: targetNames)
41+
let targetsToFormat = targetNames.isEmpty ? context.package.targets : try context.package.targets(named: targetNames)
4242

4343
let configurationFilePath = argExtractor.extractOption(named: "configuration").first
4444

Plugins/LintPlugin/plugin.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ extension LintPlugin: CommandPlugin {
3939
// Extract the arguments that specify what targets to format.
4040
var argExtractor = ArgumentExtractor(arguments)
4141
let targetNames = argExtractor.extractOption(named: "target")
42-
let targetsToFormat = try context.package.targets(named: targetNames)
4342

43+
let targetsToFormat = targetNames.isEmpty ? context.package.targets : try context.package.targets(named: targetNames)
4444
let configurationFilePath = argExtractor.extractOption(named: "configuration").first
4545

4646
let sourceCodeTargets = targetsToFormat.compactMap { $0 as? SourceModuleTarget }

0 commit comments

Comments
 (0)