File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 2121// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222// THE SOFTWARE.
2323
24+ import Foundation
2425import SwiftSyntax
2526
27+ fileprivate extension String {
28+ func removingNewLines( ) -> String {
29+ guard self . firstIndex ( of: " \n " ) != nil else {
30+ return self
31+ }
32+ return self
33+ . replacingOccurrences ( of: #"\n"# , with: " " , options: . regularExpression)
34+ . replacingOccurrences ( of: #"\s+"# , with: " " , options: . regularExpression)
35+ }
36+ }
37+
2638
2739@resultBuilder
2840fileprivate struct StringBuilder {
@@ -74,7 +86,7 @@ public struct SwiftDeclaration {
7486 self . comments = decl. comments
7587 self . accessLevel = decl. accessLevel
7688 self . keyword = decl. keyword
77- self . name = Self . buildName ( decl: decl, path: path)
89+ self . name = Self . buildName ( decl: decl, path: path) . removingNewLines ( )
7890 self . line = location. line
7991 self . column = location. column
8092 }
Original file line number Diff line number Diff line change @@ -152,8 +152,8 @@ struct SwiftDocCoverage: ParsableCommand {
152152 var urls = [ URL] ( )
153153
154154 let regex : NSRegularExpression ? = ignoreFilenameRegex. isEmpty
155- ? nil
156- : try NSRegularExpression ( pattern: ignoreFilenameRegex)
155+ ? nil
156+ : try NSRegularExpression ( pattern: ignoreFilenameRegex)
157157
158158 let url = URL ( fileURLWithPath: path)
159159 let resourceKeys = Set < URLResourceKey > ( [ . nameKey, . isDirectoryKey] )
You can’t perform that action at this time.
0 commit comments