From f384f62094b49f4420db0a0b78466f957949f6ab Mon Sep 17 00:00:00 2001 From: Kim de Vos Date: Fri, 13 Dec 2024 12:04:17 +0100 Subject: [PATCH 1/2] Add Swift package index --- .spi.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .spi.yml diff --git a/.spi.yml b/.spi.yml new file mode 100644 index 000000000..bde5eb41c --- /dev/null +++ b/.spi.yml @@ -0,0 +1,11 @@ +# This is manifest file for the Swift Package Index for it to +# auto-generate and host DocC documentation. +# For reference see https://swiftpackageindex.com/swiftpackageindex/spimanifest/documentation/spimanifest/commonusecases#Host-DocC-documentation-in-the-Swift-Package-Index. + +version: 1 +builder: + configs: + - documentation_targets: + # First item in the list is the "landing" (default) target + - SwiftFormat + custom_documentation_parameters: [--experimental-skip-synthesized-symbols] From dba874b4af371ea1e9030bfd040d2854cb45e7a3 Mon Sep 17 00:00:00 2001 From: Kim de Vos Date: Sat, 14 Dec 2024 11:28:40 +0100 Subject: [PATCH 2/2] Fix documentation --- Sources/SwiftFormat/API/SwiftFormatter.swift | 4 ++-- Sources/SwiftFormat/API/SwiftLinter.swift | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Sources/SwiftFormat/API/SwiftFormatter.swift b/Sources/SwiftFormat/API/SwiftFormatter.swift index ddd0bbe2c..6e06015cf 100644 --- a/Sources/SwiftFormat/API/SwiftFormatter.swift +++ b/Sources/SwiftFormat/API/SwiftFormatter.swift @@ -45,7 +45,7 @@ public final class SwiftFormatter { /// This form of the `format` function automatically folds expressions using the default operator /// set defined in Swift. If you need more control over this—for example, to provide the correct /// precedence relationships for custom operators—you must parse and fold the syntax tree - /// manually and then call ``format(syntax:assumingFileURL:to:)``. + /// manually and then call ``format(syntax:source:operatorTable:assumingFileURL:selection:to:)``. /// /// - Parameters: /// - url: The URL of the file containing the code to format. @@ -81,7 +81,7 @@ public final class SwiftFormatter { /// This form of the `format` function automatically folds expressions using the default operator /// set defined in Swift. If you need more control over this—for example, to provide the correct /// precedence relationships for custom operators—you must parse and fold the syntax tree - /// manually and then call ``format(syntax:assumingFileURL:to:)``. + /// manually and then call ``format(syntax:source:operatorTable:assumingFileURL:selection:to:)``. /// /// - Parameters: /// - source: The Swift source code to be formatted. diff --git a/Sources/SwiftFormat/API/SwiftLinter.swift b/Sources/SwiftFormat/API/SwiftLinter.swift index cfc4639f6..d70f30673 100644 --- a/Sources/SwiftFormat/API/SwiftLinter.swift +++ b/Sources/SwiftFormat/API/SwiftLinter.swift @@ -45,7 +45,7 @@ public final class SwiftLinter { /// This form of the `lint` function automatically folds expressions using the default operator /// set defined in Swift. If you need more control over this—for example, to provide the correct /// precedence relationships for custom operators—you must parse and fold the syntax tree - /// manually and then call ``lint(syntax:assumingFileURL:)``. + /// manually and then call ``lint(syntax:source:operatorTable:assumingFileURL:)``. /// /// - Parameters: /// - url: The URL of the file containing the code to format. @@ -76,7 +76,7 @@ public final class SwiftLinter { /// This form of the `lint` function automatically folds expressions using the default operator /// set defined in Swift. If you need more control over this—for example, to provide the correct /// precedence relationships for custom operators—you must parse and fold the syntax tree - /// manually and then call ``lint(syntax:assumingFileURL:)``. + /// manually and then call ``lint(syntax:source:operatorTable:assumingFileURL:)``. /// /// - Parameters: /// - source: The Swift source code to be linted. @@ -124,6 +124,7 @@ public final class SwiftLinter { /// /// - Parameters: /// - syntax: The Swift syntax tree to be converted to be linted. + /// - source: The Swift source code to be linted. /// - operatorTable: The table that defines the operators and their precedence relationships. /// This must be the same operator table that was used to fold the expressions in the `syntax` /// argument.