File tree 1 file changed +4
-2
lines changed
Sources/swift-format/Frontend 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -117,17 +117,19 @@ class Frontend {
117
117
118
118
/// Processes source content from standard input.
119
119
private func processStandardInput( ) {
120
+ let assumedUrl = lintFormatOptions. assumeFilename. map ( URL . init ( fileURLWithPath: ) )
121
+
120
122
guard let configuration = configuration (
121
123
fromPathOrString: lintFormatOptions. configuration,
122
- orInferredFromSwiftFileAt: nil )
124
+ orInferredFromSwiftFileAt: assumedUrl )
123
125
else {
124
126
// Already diagnosed in the called method.
125
127
return
126
128
}
127
129
128
130
let fileToProcess = FileToProcess (
129
131
fileHandle: FileHandle . standardInput,
130
- url: URL ( fileURLWithPath: lintFormatOptions . assumeFilename ?? " <stdin> " ) ,
132
+ url: assumedUrl ?? URL ( fileURLWithPath: " <stdin> " ) ,
131
133
configuration: configuration,
132
134
selection: Selection ( offsetRanges: lintFormatOptions. offsets) )
133
135
processFile ( fileToProcess)
You can’t perform that action at this time.
0 commit comments