From 8c22eb6530d83be8e7c33d5d1ca60bb1b40476ee Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Wed, 19 Feb 2025 11:53:37 +0100 Subject: [PATCH] Fix rejected assumeFilename when path argument is '-' --- Sources/swift-format/Subcommands/LintFormatOptions.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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") }