Skip to content

Commit 5afe05e

Browse files
committed
Gradually deprecate running swift-format without input paths; require '-' for stdin in the future
1 parent 6e64b26 commit 5afe05e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/swift-format/Frontend/Frontend.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@ class Frontend {
9797

9898
/// Runs the linter or formatter over the inputs.
9999
final func run() {
100-
if lintFormatOptions.paths.isEmpty {
100+
if lintFormatOptions.paths == ["-"] {
101+
processStandardInput()
102+
} else if lintFormatOptions.paths.isEmpty {
103+
diagnosticsEngine.emitWarning(
104+
"running swift-format with no input paths is deprecated and will be removed in the future; specify '-' to use stdin"
105+
)
101106
processStandardInput()
102107
} else {
103108
processURLs(

0 commit comments

Comments
 (0)