Skip to content

Commit 8c22eb6

Browse files
committed
Fix rejected assumeFilename when path argument is '-'
1 parent a2acc60 commit 8c22eb6

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
@@ -107,7 +107,7 @@ struct LintFormatOptions: ParsableArguments {
107107
throw ValidationError("'--recursive' is only valid when formatting or linting files")
108108
}
109109

110-
if assumeFilename != nil && !paths.isEmpty {
110+
if assumeFilename != nil && !(paths.isEmpty || paths == ["-"]) {
111111
throw ValidationError("'--assume-filename' is only valid when reading from stdin")
112112
}
113113

0 commit comments

Comments
 (0)