Skip to content

Commit a64e12b

Browse files
authored
Merge pull request swiftlang#133 from allevato/remove-old-comments
[NFC] Remove links to Google's style guide in comments.
2 parents c445070 + 3fc582b commit a64e12b

35 files changed

+0
-74
lines changed

Sources/SwiftFormatRules/AllPublicDeclarationsHaveDocumentation.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import SwiftSyntax
1717
/// All public or open declarations must have a top-level documentation comment.
1818
///
1919
/// Lint: If a public declaration is missing a documentation comment, a lint error is raised.
20-
///
21-
/// - SeeAlso: https://google.github.io/swift#where-to-document
2220
public final class AllPublicDeclarationsHaveDocumentation: SyntaxLintRule {
2321

2422
public override func visit(_ node: FunctionDeclSyntax) -> SyntaxVisitorContinueKind {

Sources/SwiftFormatRules/AlwaysUseLowerCamelCase.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import SwiftSyntax
1919
///
2020
/// Lint: If an identifier contains underscores or begins with a capital letter, a lint error is
2121
/// raised.
22-
///
23-
/// - SeeAlso: https://google.github.io/swift#identifiers
2422
public final class AlwaysUseLowerCamelCase: SyntaxLintRule {
2523

2624
public override func visit(_ node: VariableDeclSyntax) -> SyntaxVisitorContinueKind {

Sources/SwiftFormatRules/AmbiguousTrailingClosureOverload.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import SwiftSyntax
1818
///
1919
/// Lint: If two overloaded functions with one closure parameter appear in the same scope, a lint
2020
/// error is raised.
21-
///
22-
/// - SeeAlso: https://google.github.io/swift#trailing-closures
2321
public final class AmbiguousTrailingClosureOverload: SyntaxLintRule {
2422

2523
func diagnoseBadOverloads(_ overloads: [String: [FunctionDeclSyntax]]) {

Sources/SwiftFormatRules/BeginDocumentationCommentWithOneLineSummary.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import SwiftSyntax
1717
/// All documentation comments must begin with a one-line summary of the declaration.
1818
///
1919
/// Lint: If a comment does not begin with a single-line summary, a lint error is raised.
20-
///
21-
/// - SeeAlso: https://google.github.io/swift#single-sentence-summary
2220
public final class BeginDocumentationCommentWithOneLineSummary: SyntaxLintRule {
2321

2422
/// Unit tests can testably import this module and set this to true in order to force the rule

Sources/SwiftFormatRules/DoNotUseSemicolons.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import SwiftSyntax
1919
/// Lint: If a semicolon appears anywhere, a lint error is raised.
2020
///
2121
/// Format: All semicolons will be replaced with line breaks.
22-
///
23-
/// - SeeAlso: https://google.github.io/swift#semicolons
2422
public final class DoNotUseSemicolons: SyntaxFormatRule {
2523

2624
/// Creates a new version of the given node which doesn't contain any semicolons. The node's

Sources/SwiftFormatRules/DontRepeatTypeInStaticProperties.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import SwiftSyntax
2121
/// `public class var redColor: UIColor` would trigger this rule.
2222
///
2323
/// Lint: Static properties of a type that return that type will yield a lint error.
24-
///
25-
/// - SeeAlso: https://google.github.io/swift#static-and-class-properties
2624
public final class DontRepeatTypeInStaticProperties: SyntaxLintRule {
2725

2826
public override func visit(_ node: ClassDeclSyntax) -> SyntaxVisitorContinueKind {

Sources/SwiftFormatRules/FullyIndirectEnum.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import SwiftSyntax
2121
///
2222
/// Format: Enums where all cases are `indirect` will be rewritten such that the enum is marked
2323
/// `indirect`, and each case is not.
24-
///
25-
/// - SeeAlso: https://google.github.io/swift#enum-cases
2624
public final class FullyIndirectEnum: SyntaxFormatRule {
2725

2826
public override func visit(_ node: EnumDeclSyntax) -> DeclSyntax {

Sources/SwiftFormatRules/GroupNumericLiterals.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ import SwiftSyntax
2626
/// TODO: Minimum numeric literal length bounds and numeric groupings have been selected arbitrarily;
2727
/// these could be reevaluated.
2828
/// TODO: Handle floating point literals.
29-
///
30-
/// - SeeAlso: https://google.github.io/swift#numeric-literals
3129
public final class GroupNumericLiterals: SyntaxFormatRule {
3230
public override func visit(_ node: IntegerLiteralExprSyntax) -> ExprSyntax {
3331
var originalDigits = node.digits.text

Sources/SwiftFormatRules/IdentifiersMustBeASCII.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import SwiftSyntax
1717
/// All identifiers must be ASCII.
1818
///
1919
/// Lint: If an identifier contains non-ASCII characters, a lint error is raised.
20-
///
21-
/// - SeeAlso: https://google.github.io/swift#identifiers
2220
public final class IdentifiersMustBeASCII: SyntaxLintRule {
2321

2422
public override func visit(_ node: IdentifierPatternSyntax) -> SyntaxVisitorContinueKind {

Sources/SwiftFormatRules/NeverForceUnwrap.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ import SwiftSyntax
1616
/// Force-unwraps are strongly discouraged and must be documented.
1717
///
1818
/// Lint: If a force unwrap is used, a lint warning is raised.
19-
/// TODO(abl): consider having documentation (e.g. a comment) cancel the warning?
20-
///
21-
/// - SeeAlso: https://google.github.io/swift#force-unwrapping-and-force-casts
2219
public final class NeverForceUnwrap: SyntaxLintRule {
2320

2421
public override func visit(_ node: SourceFileSyntax) -> SyntaxVisitorContinueKind {

Sources/SwiftFormatRules/NeverUseForceTry.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ import SwiftSyntax
2222
/// Lint: Using `try!` results in a lint error.
2323
///
2424
/// TODO: Create exception for NSRegularExpression
25-
///
26-
/// - SeeAlso: https://google.github.io/swift#error-types
2725
public final class NeverUseForceTry: SyntaxLintRule {
2826

2927
public override func visit(_ node: SourceFileSyntax) -> SyntaxVisitorContinueKind {

Sources/SwiftFormatRules/NeverUseImplicitlyUnwrappedOptionals.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ import SwiftSyntax
2424
/// TODO: Create exceptions for other UI elements (ex: viewDidLoad)
2525
///
2626
/// Lint: Declaring a property with an implicitly unwrapped type yields a lint error.
27-
///
28-
/// - SeeAlso: https://google.github.io/swift#implicitly-unwrapped-optionals
2927
public final class NeverUseImplicitlyUnwrappedOptionals: SyntaxLintRule {
3028

3129
// Checks if "XCTest" is an import statement

Sources/SwiftFormatRules/NoAccessLevelOnExtensionDeclaration.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import SwiftSyntax
2323
/// `internal`, as that is the default access level) have the explicit access level removed.
2424
///
2525
/// TODO: Find a better way to access modifiers and keyword tokens besides casting each declaration
26-
///
27-
/// - SeeAlso: https://google.github.io/swift#access-levels
2826
public final class NoAccessLevelOnExtensionDeclaration: SyntaxFormatRule {
2927

3028
public override func visit(_ node: ExtensionDeclSyntax) -> DeclSyntax {

Sources/SwiftFormatRules/NoBlockComments.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import SwiftSyntax
1717
/// Block comments should be avoided in favor of line comments.
1818
///
1919
/// Lint: If a block comment appears, a lint error is raised.
20-
///
21-
/// - SeeAlso: https://google.github.io/swift#non-documentation-comments
2220
public final class NoBlockComments: SyntaxLintRule {
2321
public override func visit(_ token: TokenSyntax) -> SyntaxVisitorContinueKind {
2422
for triviaIndex in token.leadingTrivia.indices {

Sources/SwiftFormatRules/NoCasesWithOnlyFallthrough.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import SwiftSyntax
2020
///
2121
/// Format: The fallthrough `case` is added as a prefix to the next case unless the next case is
2222
/// `default`; in that case, the fallthrough `case` is deleted.
23-
///
24-
/// - SeeAlso: https://google.github.io/swift#fallthrough-in-switch-statements
2523
public final class NoCasesWithOnlyFallthrough: SyntaxFormatRule {
2624

2725
public override func visit(_ node: SwitchCaseListSyntax) -> Syntax {

Sources/SwiftFormatRules/NoEmptyTrailingClosureParentheses.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import SwiftSyntax
2020
/// a lint error is raised.
2121
///
2222
/// Format: Empty parentheses in function calls with trailing closures will be removed.
23-
///
24-
/// - SeeAlso: https://google.github.io/swift#trailing-closures
2523
public final class NoEmptyTrailingClosureParentheses: SyntaxFormatRule {
2624

2725
public override func visit(_ node: FunctionCallExprSyntax) -> ExprSyntax {

Sources/SwiftFormatRules/NoLabelsInCasePatterns.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ import SwiftSyntax
2222
/// binding identifier.
2323
///
2424
/// Format: Redundant labels in case patterns are removed.
25-
///
26-
/// - SeeAlso: https://google.github.io/swift#pattern-matching
2725
public final class NoLabelsInCasePatterns: SyntaxFormatRule {
2826
public override func visit(_ node: SwitchCaseLabelSyntax) -> Syntax {
2927

Sources/SwiftFormatRules/NoLeadingUnderscores.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ import SwiftSyntax
2424
/// sites.
2525
///
2626
/// Lint: Declaring an identifier with a leading underscore yields a lint error.
27-
///
28-
/// - SeeAlso: https://google.github.io/swift#naming-conventions-are-not-access-control
2927
public final class NoLeadingUnderscores: SyntaxLintRule {
3028

3129
public override func visit(_ node: AssociatedtypeDeclSyntax) -> SyntaxVisitorContinueKind {

Sources/SwiftFormatRules/NoParensAroundConditions.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ import SwiftSyntax
2626
/// Format: Parentheses around such expressions are removed, if they do not cause a parse ambiguity.
2727
/// Specifically, parentheses are allowed if and only if the expression contains a function
2828
/// call with a trailing closure.
29-
///
30-
/// - SeeAlso: https://google.github.io/swift#parentheses
3129
public final class NoParensAroundConditions: SyntaxFormatRule {
3230
func extractExpr(_ tuple: TupleExprSyntax) -> ExprSyntax {
3331
assert(tuple.elementList.count == 1)

Sources/SwiftFormatRules/NoPlaygroundLiterals.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ import SwiftSyntax
2626
/// `#colorLiteral(...)` becomes `UIColor(...)`
2727
///
2828
/// Configuration: resolveAmbiguousColor
29-
///
30-
/// - SeeAlso: https://google.github.io/swift#playground-literals
3129
public final class NoPlaygroundLiterals: SyntaxFormatRule {
3230

3331
}

Sources/SwiftFormatRules/NoVoidReturnOnFunctionSignature.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import SwiftSyntax
1919
///
2020
/// Format: Function declarations with explicit returns of `()` or `Void` will have their return
2121
/// signature stripped.
22-
///
23-
/// - SeeAlso: https://google.github.io/swift#types-with-shorthand-names
2422
public final class NoVoidReturnOnFunctionSignature: SyntaxFormatRule {
2523
/// Remove the `-> Void` return type for function signatures. Do not remove
2624
/// it for closure signatures, because that may introduce an ambiguity when closure signatures

Sources/SwiftFormatRules/OneCasePerLine.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import SwiftSyntax
2121
///
2222
/// Format: All case declarations with associated values or raw values will be moved to their own
2323
/// case declarations.
24-
///
25-
/// - SeeAlso: https://google.github.io/swift#enum-cases
2624
public final class OneCasePerLine: SyntaxFormatRule {
2725

2826
/// A state machine that collects case elements encountered during visitation and allows new case

Sources/SwiftFormatRules/OneVariableDeclarationPerLine.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import SwiftSyntax
2020
///
2121
/// Format: If a variable declaration declares multiple variables, it will be split into multiple
2222
/// declarations, each declaring one of the variables.
23-
///
24-
/// - SeeAlso: https://google.github.io/swift#properties
2523
public final class OneVariableDeclarationPerLine: SyntaxFormatRule {
2624
func splitVariableDecls(
2725
_ items: CodeBlockItemListSyntax

Sources/SwiftFormatRules/OnlyOneTrailingClosureArgument.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import SwiftSyntax
1818
///
1919
/// Lint: If a function call with a trailing closure also contains a non-trailing closure argument,
2020
/// a lint error is raised.
21-
///
22-
/// - SeeAlso: https://google.github.io/swift#trailing-closures
2321
public final class OnlyOneTrailingClosureArgument: SyntaxLintRule {
2422

2523
public override func visit(_ node: FunctionCallExprSyntax) -> SyntaxVisitorContinueKind {

Sources/SwiftFormatRules/OrderedImports.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ import SwiftSyntax
2424
/// raised.
2525
///
2626
/// Format: Imports will be reordered and grouped at the top of the file.
27-
///
28-
/// - SeeAlso: https://google.github.io/swift#import-statements
2927
public final class OrderedImports: SyntaxFormatRule {
3028

3129
public override func visit(_ node: SourceFileSyntax) -> Syntax {

Sources/SwiftFormatRules/ReturnVoidInsteadOfEmptyTuple.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ import SwiftSyntax
2222
/// Lint: Returning `()` in a signature yields a lint error.
2323
///
2424
/// Format: `-> ()` is replaced with `-> Void`
25-
///
26-
/// - SeeAlso: https://google.github.io/swift#types-with-shorthand-names
2725
public final class ReturnVoidInsteadOfEmptyTuple: SyntaxFormatRule {
2826
public override func visit(_ node: FunctionTypeSyntax) -> TypeSyntax {
2927
guard let returnType = node.returnType.as(TupleTypeSyntax.self),

Sources/SwiftFormatRules/UseEarlyExits.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ import SwiftSyntax
4343
///
4444
/// Format: `if ... else { return/throw/break/continue }` constructs will be replaced with
4545
/// equivalent `guard ... else { return/throw/break/continue }` constructs.
46-
///
47-
/// - SeeAlso: https://google.github.io/swift#guards-for-early-exits
4846
public final class UseEarlyExits: SyntaxFormatRule {
4947

5048
public override func visit(_ node: CodeBlockItemListSyntax) -> Syntax {

Sources/SwiftFormatRules/UseEnumForNamespacing.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ import SwiftSyntax
2626
/// Lint: `struct`s consisting of only `static let/func`s will yield a lint error.
2727
///
2828
/// Format: Rewrite the `struct` as an `enum`.
29-
///
30-
/// - SeeAlso: https://google.github.io/swift#nesting-and-namespacing
3129
public final class UseEnumForNamespacing: SyntaxFormatRule {
3230

3331
public override func visit(_ node: StructDeclSyntax) -> DeclSyntax {

Sources/SwiftFormatRules/UseLetInEveryBoundCaseVariable.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ import SwiftSyntax
1919
/// e.g. `case let .label(foo, bar)` is forbidden.
2020
///
2121
/// Lint: `case let ...` will yield a lint error.
22-
///
23-
/// Format: The `let` will be distributed across each element.
24-
/// TODO(abl): This is not a neutral format operation.
25-
///
26-
/// - SeeAlso: https://google.github.io/swift#pattern-matching
2722
public final class UseLetInEveryBoundCaseVariable: SyntaxLintRule {
2823

2924
public override func visit(_ node: SwitchCaseLabelSyntax) -> SyntaxVisitorContinueKind {

Sources/SwiftFormatRules/UseShorthandTypeNames.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import SwiftSyntax
2121
///
2222
/// Format: Where possible, shorthand types replace long form types; e.g. `Array<Element>` is
2323
/// converted to `[Element]`.
24-
///
25-
/// - SeeAlso: https://google.github.io/swift#types-with-shorthand-names
2624
public final class UseShorthandTypeNames: SyntaxFormatRule {
2725

2826
public override func visit(_ node: SimpleTypeIdentifierSyntax) -> TypeSyntax {

Sources/SwiftFormatRules/UseSingleLinePropertyGetter.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import SwiftSyntax
1919
/// Lint: Read-only computed properties with explicit `get` blocks yield a lint error.
2020
///
2121
/// Format: Explicit `get` blocks are rendered implicit by removing the `get`.
22-
///
23-
/// - SeeAlso: https://google.github.io/swift#properties-2
2422
public final class UseSingleLinePropertyGetter: SyntaxFormatRule {
2523

2624
public override func visit(_ node: PatternBindingSyntax) -> Syntax {

Sources/SwiftFormatRules/UseSynthesizedInitializer.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import SwiftSyntax
2121
///
2222
/// Lint: (Non-public) memberwise initializers with the same structure as the synthesized
2323
/// initializer will yield a lint error.
24-
///
25-
/// - SeeAlso: https://google.github.io/swift#initializers-2
2624
public final class UseSynthesizedInitializer: SyntaxLintRule {
2725

2826
public override func visit(_ node: StructDeclSyntax) -> SyntaxVisitorContinueKind {

Sources/SwiftFormatRules/UseTripleSlashForDocumentationComments.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import SwiftSyntax
2323
/// Format: If a doc block comment appears on its own on a line, or if a doc block comment spans
2424
/// multiple lines without appearing on the same line as code, it will be replaced with
2525
/// multiple doc line comments.
26-
///
27-
/// - SeeAlso: https://google.github.io/swift#general-format
2826
public final class UseTripleSlashForDocumentationComments: SyntaxFormatRule {
2927
public override func visit(_ node: FunctionDeclSyntax) -> DeclSyntax {
3028
return convertDocBlockCommentToDocLineComment(DeclSyntax(node))

Sources/SwiftFormatRules/UseWhereClausesInForLoops.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import SwiftSyntax
2020
///
2121
/// Format: `for` loops that consist of a single `if` statement have the conditional of that
2222
/// statement factored out to a `where` clause.
23-
///
24-
/// - SeeAlso: https://google.github.io/swift#for-where-loops
2523
public final class UseWhereClausesInForLoops: SyntaxFormatRule {
2624

2725
public override func visit(_ node: ForInStmtSyntax) -> StmtSyntax {

Sources/SwiftFormatRules/ValidateDocumentationComments.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import SwiftSyntax
2020
///
2121
/// Lint: Documentation comments that are incomplete (e.g. missing parameter documentation) or
2222
/// invalid (uses `Parameters` when there is only one parameter) will yield a lint error.
23-
///
24-
/// - SeeAlso: https://google.github.io/swift#parameter-returns-and-throws-tags
2523
public final class ValidateDocumentationComments: SyntaxLintRule {
2624

2725
public override func visit(_ node: InitializerDeclSyntax) -> SyntaxVisitorContinueKind {

0 commit comments

Comments
 (0)