File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Sources/swift-format/Frontend Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -117,17 +117,19 @@ class Frontend {
117117
118118 /// Processes source content from standard input.
119119 private func processStandardInput( ) {
120+ let assumedUrl = lintFormatOptions. assumeFilename. map ( URL . init ( fileURLWithPath: ) )
121+
120122 guard let configuration = configuration (
121123 fromPathOrString: lintFormatOptions. configuration,
122- orInferredFromSwiftFileAt: nil )
124+ orInferredFromSwiftFileAt: assumedUrl )
123125 else {
124126 // Already diagnosed in the called method.
125127 return
126128 }
127129
128130 let fileToProcess = FileToProcess (
129131 fileHandle: FileHandle . standardInput,
130- url: URL ( fileURLWithPath: lintFormatOptions . assumeFilename ?? " <stdin> " ) ,
132+ url: assumedUrl ?? URL ( fileURLWithPath: " <stdin> " ) ,
131133 configuration: configuration,
132134 selection: Selection ( offsetRanges: lintFormatOptions. offsets) )
133135 processFile ( fileToProcess)
You can’t perform that action at this time.
0 commit comments