diff --git a/Sources/swift-format/Subcommands/LintFormatOptions.swift b/Sources/swift-format/Subcommands/LintFormatOptions.swift index ca1232912..25fdcaf68 100644 --- a/Sources/swift-format/Subcommands/LintFormatOptions.swift +++ b/Sources/swift-format/Subcommands/LintFormatOptions.swift @@ -107,7 +107,7 @@ struct LintFormatOptions: ParsableArguments { throw ValidationError("'--recursive' is only valid when formatting or linting files") } - if assumeFilename != nil && !paths.isEmpty { + if assumeFilename != nil && !(paths.isEmpty || paths == ["-"]) { throw ValidationError("'--assume-filename' is only valid when reading from stdin") }