Update SwiftSyntaxRule.swift (#4749)

This commit is contained in:
Marcelo Fabri 2023-02-06 11:16:18 -08:00 committed by GitHub
parent 0163ffd328
commit 60d0dd8a05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -19,9 +19,10 @@ public protocol SwiftSyntaxRule: SourceKitFreeRule {
/// Gives a chance for the rule to do some pre-processing on the syntax tree.
/// One typical example is using `SwiftOperators` to "fold" the tree, resolving operators precedence.
/// By default, it just returns the same `syntaxTree`.
/// This can also be used to skip validation in a given file.
/// By default, it just returns the file's `syntaxTree`.
///
/// - parameter syntaxTree: The syntax tree to run pre-processing on
/// - parameter file: The file to run pre-processing on.
///
/// - returns: The tree that will be used to check for violations. If `nil`, this rule will return no violations.
func preprocess(file: SwiftLintFile) -> SourceFileSyntax?