File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,14 @@ struct AirbnbSwiftFormatPlugin: CommandPlugin {
2020 // specifying the targets selected in the plugin dialog.
2121 let inputTargets = argumentExtractor. extractOption ( named: " target " )
2222
23- var inputPaths : [ String ]
23+ // If given, lint only the paths passed to `--paths`
24+ var inputPaths = argumentExtractor. extractOption ( named: " paths " )
25+
2426 if !inputTargets. isEmpty {
2527 // If a set of input targets were given, lint/format the directory for each of them
26- inputPaths = try context. package . targets ( named: inputTargets) . map { $0. directory. string }
27- } else {
28- // Otherwise if no targets we listed we default to linting/formatting
28+ inputPaths + = try context. package . targets ( named: inputTargets) . map { $0. directory. string }
29+ } else if inputPaths . isEmpty {
30+ // Otherwise if no targets or paths listed we default to linting/formatting
2931 // the entire package directory.
3032 inputPaths = try self . inputPaths ( for: context. package )
3133 }
You can’t perform that action at this time.
0 commit comments