Skip to content

Commit 32ddb82

Browse files
committed
Allow empty paths to imply reading from stdin.
This has been supported for a long time, but a recent change in swift-argument-parser 0.3.0 changed the behavior for non-nullable array types as arguments. Previously, the argument parser defaulted them to empty arrays. The suggested migration is to simply specify a default empty array for optional array arguments. Reference: https://github.com/apple/swift-argument-parser/releases/tag/0.3.0
1 parent 5986f65 commit 32ddb82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/swift-format/Subcommands/LintFormatOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct LintFormatOptions: ParsableArguments {
5151

5252
/// The list of paths to Swift source files that should be formatted or linted.
5353
@Argument(help: "Zero or more input filenames.")
54-
var paths: [String]
54+
var paths: [String] = []
5555

5656
@Flag(help: .hidden) var debugDisablePrettyPrint: Bool
5757
@Flag(help: .hidden) var debugDumpTokenStream: Bool

0 commit comments

Comments
 (0)