From d8161173f3b1e2086abae197a48fe818d816848f Mon Sep 17 00:00:00 2001 From: Tony Allevato Date: Mon, 4 Sep 2023 21:28:49 -0400 Subject: [PATCH] Move `Configuration` into the `SwiftFormat` module. The `SwiftFormatConfiguration` module still exists for compatibility, but now the dependency is inverted; it imports `SwiftFormat` and re-exports the symbols that used to live in `SwiftFormatConfiguration`. This compatibility layer will be deleted after the next major release. As of this change, only the `SwiftFormat` module remains as public API. --- Documentation/Development.md | 16 ++++------------ Package.swift | 15 ++++++--------- .../API}/Configuration+Default.swift | 0 .../API}/Configuration.swift | 0 .../API}/Indent.swift | 0 Sources/SwiftFormat/API/SwiftFormatter.swift | 1 - Sources/SwiftFormat/API/SwiftLinter.swift | 1 - Sources/SwiftFormat/Core/Context.swift | 1 - .../Core}/RuleRegistry+Generated.swift | 0 Sources/SwiftFormat/PrettyPrint/Comment.swift | 1 - .../PrettyPrint/Indent+Length.swift | 2 -- .../SwiftFormat/PrettyPrint/PrettyPrint.swift | 1 - .../PrettyPrint/TokenStreamCreator.swift | 1 - .../SwiftFormat/PrettyPrint/Verbatim.swift | 1 - .../PrettyPrint/WhitespaceLinter.swift | 1 - .../Rules/NoAssignmentInExpressions.swift | 1 - .../Compatibility.swift | 19 +++++++++++++++++++ .../Configuration+Testing.swift | 2 +- .../DiagnosingTestCase.swift | 2 +- Sources/generate-pipeline/main.swift | 3 ++- .../Frontend/ConfigurationLoader.swift | 2 +- .../Frontend/FormatFrontend.swift | 1 - Sources/swift-format/Frontend/Frontend.swift | 1 - .../swift-format/Frontend/LintFrontend.swift | 1 - .../Subcommands/DumpConfiguration.swift | 2 +- .../API}/ConfigurationTests.swift | 2 +- .../PrettyPrint/AssignmentExprTests.swift | 2 +- .../PrettyPrint/AttributeTests.swift | 2 +- .../PrettyPrint/AwaitExprTests.swift | 2 +- .../PrettyPrint/BinaryOperatorExprTests.swift | 2 +- .../PrettyPrint/ClassDeclTests.swift | 2 +- .../PrettyPrint/ClosureExprTests.swift | 2 +- .../PrettyPrint/DeclNameArgumentTests.swift | 2 +- .../PrettyPrint/DoStmtTests.swift | 2 +- .../PrettyPrint/EnumDeclTests.swift | 2 +- .../PrettyPrint/ExtensionDeclTests.swift | 2 +- .../PrettyPrint/FunctionCallTests.swift | 2 +- .../PrettyPrint/FunctionDeclTests.swift | 2 +- .../PrettyPrint/IfConfigTests.swift | 2 +- .../PrettyPrint/IfStmtTests.swift | 2 +- .../PrettyPrint/InitializerDeclTests.swift | 2 +- .../PrettyPrint/MacroCallTests.swift | 2 +- .../PrettyPrint/MacroDeclTests.swift | 2 +- .../PrettyPrint/MemberAccessExprTests.swift | 2 +- .../PrettyPrint/ObjectLiteralExprTests.swift | 2 +- .../PrettyPrint/OperatorDeclTests.swift | 2 +- .../PrettyPrint/PatternBindingTests.swift | 2 +- .../PrettyPrint/PrettyPrintTestCase.swift | 2 +- .../PrettyPrint/ProtocolDeclTests.swift | 2 +- .../PrettyPrint/RepeatStmtTests.swift | 2 +- .../RespectsExistingLineBreaksTests.swift | 2 +- .../PrettyPrint/StructDeclTests.swift | 2 +- .../PrettyPrint/SubscriptDeclTests.swift | 2 +- .../SwitchCaseIndentConfigTests.swift | 2 +- .../PrettyPrint/SwitchStmtTests.swift | 2 +- .../PrettyPrint/TryCatchTests.swift | 2 +- .../PrettyPrint/WhitespaceLintTests.swift | 1 - .../PrettyPrint/WhitespaceTestCase.swift | 2 +- .../FileScopedDeclarationPrivacyTests.swift | 2 +- .../Rules/ImportsXCTestVisitorTests.swift | 2 +- .../Rules/LintOrFormatRuleTestCase.swift | 2 +- 61 files changed, 70 insertions(+), 76 deletions(-) rename Sources/{SwiftFormatConfiguration => SwiftFormat/API}/Configuration+Default.swift (100%) rename Sources/{SwiftFormatConfiguration => SwiftFormat/API}/Configuration.swift (100%) rename Sources/{SwiftFormatConfiguration => SwiftFormat/API}/Indent.swift (100%) rename Sources/{SwiftFormatConfiguration => SwiftFormat/Core}/RuleRegistry+Generated.swift (100%) create mode 100644 Sources/SwiftFormatConfiguration/Compatibility.swift rename Tests/{SwiftFormatConfigurationTests => SwiftFormatTests/API}/ConfigurationTests.swift (96%) diff --git a/Documentation/Development.md b/Documentation/Development.md index 8773f051..5445d2ed 100644 --- a/Documentation/Development.md +++ b/Documentation/Development.md @@ -4,7 +4,7 @@ Since Swift does not yet have a runtime reflection system, we use code generation to keep the linting/formatting pipeline up-to-date. If you add or -remove any rules from the `SwiftFormatRules` module, or if you add or remove +remove any rules from the `SwiftFormat` module, or if you add or remove any `visit` methods from an existing rule in that module, you must run the `generate-pipeline` tool update the pipeline and configuration sources. @@ -14,17 +14,9 @@ The easiest way to do this is to run the following command in your terminal: swift run generate-pipeline ``` -If successful, this tool will update -`Sources/SwiftFormatConfiguration/RuleRegistry+Generated.swift` and -`Sources/SwiftFormat/Pipelines+Generated.swift`. - -Likewise, you should keep the Linux XCTest manifests updated if you add or -remove any tests from `swift-format` by running the following command in your -terminal: - -```shell -swift test --generate-linuxmain -``` +If successful, this tool will update the files `Pipelines+Generated.swift`, +`RuleNameCache+Generated.swift`, and `RuleRegistry+Generated.swift` in +the `Sources/SwiftFormat/Core` directory. ## Command Line Options for Debugging diff --git a/Package.swift b/Package.swift index 6d7045c7..12467257 100644 --- a/Package.swift +++ b/Package.swift @@ -29,6 +29,7 @@ let package = Package( name: "SwiftFormat", targets: ["SwiftFormat", "SwiftFormatConfiguration"] ), + // TODO: Remove this product after the 509 release. .library( name: "SwiftFormatConfiguration", targets: ["SwiftFormatConfiguration"] @@ -49,7 +50,6 @@ let package = Package( .target( name: "SwiftFormat", dependencies: [ - "SwiftFormatConfiguration", .product(name: "Markdown", package: "swift-markdown"), .product(name: "SwiftSyntax", package: "swift-syntax"), .product(name: "SwiftOperators", package: "swift-syntax"), @@ -57,14 +57,17 @@ let package = Package( .product(name: "SwiftParserDiagnostics", package: "swift-syntax"), ] ), + // TODO: Remove this target after the 509 release. .target( - name: "SwiftFormatConfiguration" + name: "SwiftFormatConfiguration", + dependencies: [ + "SwiftFormat" + ] ), .target( name: "_SwiftFormatTestSupport", dependencies: [ "SwiftFormat", - "SwiftFormatConfiguration", .product(name: "SwiftOperators", package: "swift-syntax"), ] ), @@ -106,17 +109,12 @@ let package = Package( name: "swift-format", dependencies: [ "SwiftFormat", - "SwiftFormatConfiguration", .product(name: "ArgumentParser", package: "swift-argument-parser"), .product(name: "SwiftSyntax", package: "swift-syntax"), .product(name: "SwiftParser", package: "swift-syntax"), ] ), - .testTarget( - name: "SwiftFormatConfigurationTests", - dependencies: ["SwiftFormatConfiguration"] - ), .testTarget( name: "SwiftFormatPerformanceTests", dependencies: [ @@ -130,7 +128,6 @@ let package = Package( name: "SwiftFormatTests", dependencies: [ "SwiftFormat", - "SwiftFormatConfiguration", "_SwiftFormatTestSupport", .product(name: "Markdown", package: "swift-markdown"), .product(name: "SwiftOperators", package: "swift-syntax"), diff --git a/Sources/SwiftFormatConfiguration/Configuration+Default.swift b/Sources/SwiftFormat/API/Configuration+Default.swift similarity index 100% rename from Sources/SwiftFormatConfiguration/Configuration+Default.swift rename to Sources/SwiftFormat/API/Configuration+Default.swift diff --git a/Sources/SwiftFormatConfiguration/Configuration.swift b/Sources/SwiftFormat/API/Configuration.swift similarity index 100% rename from Sources/SwiftFormatConfiguration/Configuration.swift rename to Sources/SwiftFormat/API/Configuration.swift diff --git a/Sources/SwiftFormatConfiguration/Indent.swift b/Sources/SwiftFormat/API/Indent.swift similarity index 100% rename from Sources/SwiftFormatConfiguration/Indent.swift rename to Sources/SwiftFormat/API/Indent.swift diff --git a/Sources/SwiftFormat/API/SwiftFormatter.swift b/Sources/SwiftFormat/API/SwiftFormatter.swift index 8ab36f0f..9230bdd8 100644 --- a/Sources/SwiftFormat/API/SwiftFormatter.swift +++ b/Sources/SwiftFormat/API/SwiftFormatter.swift @@ -12,7 +12,6 @@ import Foundation import SwiftDiagnostics -import SwiftFormatConfiguration import SwiftOperators import SwiftSyntax diff --git a/Sources/SwiftFormat/API/SwiftLinter.swift b/Sources/SwiftFormat/API/SwiftLinter.swift index c891fff3..4806f19d 100644 --- a/Sources/SwiftFormat/API/SwiftLinter.swift +++ b/Sources/SwiftFormat/API/SwiftLinter.swift @@ -12,7 +12,6 @@ import Foundation import SwiftDiagnostics -import SwiftFormatConfiguration import SwiftOperators import SwiftSyntax diff --git a/Sources/SwiftFormat/Core/Context.swift b/Sources/SwiftFormat/Core/Context.swift index 94cfc5a4..8851a685 100644 --- a/Sources/SwiftFormat/Core/Context.swift +++ b/Sources/SwiftFormat/Core/Context.swift @@ -11,7 +11,6 @@ //===----------------------------------------------------------------------===// import Foundation -import SwiftFormatConfiguration import SwiftOperators import SwiftSyntax import SwiftParser diff --git a/Sources/SwiftFormatConfiguration/RuleRegistry+Generated.swift b/Sources/SwiftFormat/Core/RuleRegistry+Generated.swift similarity index 100% rename from Sources/SwiftFormatConfiguration/RuleRegistry+Generated.swift rename to Sources/SwiftFormat/Core/RuleRegistry+Generated.swift diff --git a/Sources/SwiftFormat/PrettyPrint/Comment.swift b/Sources/SwiftFormat/PrettyPrint/Comment.swift index ee85cec4..8e119b81 100644 --- a/Sources/SwiftFormat/PrettyPrint/Comment.swift +++ b/Sources/SwiftFormat/PrettyPrint/Comment.swift @@ -11,7 +11,6 @@ //===----------------------------------------------------------------------===// import Foundation -import SwiftFormatConfiguration import SwiftSyntax extension StringProtocol { diff --git a/Sources/SwiftFormat/PrettyPrint/Indent+Length.swift b/Sources/SwiftFormat/PrettyPrint/Indent+Length.swift index e326894f..062d50a0 100644 --- a/Sources/SwiftFormat/PrettyPrint/Indent+Length.swift +++ b/Sources/SwiftFormat/PrettyPrint/Indent+Length.swift @@ -10,8 +10,6 @@ // //===----------------------------------------------------------------------===// -import SwiftFormatConfiguration - extension Indent { var character: Character { switch self { diff --git a/Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift b/Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift index 6e91d821..97a1c5fc 100644 --- a/Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift +++ b/Sources/SwiftFormat/PrettyPrint/PrettyPrint.swift @@ -10,7 +10,6 @@ // //===----------------------------------------------------------------------===// -import SwiftFormatConfiguration import SwiftSyntax /// PrettyPrinter takes a Syntax node and outputs a well-formatted, re-indented reproduction of the diff --git a/Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift b/Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift index d6b09abb..5d00dd00 100644 --- a/Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift +++ b/Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift @@ -11,7 +11,6 @@ //===----------------------------------------------------------------------===// import Foundation -import SwiftFormatConfiguration import SwiftOperators import SwiftSyntax diff --git a/Sources/SwiftFormat/PrettyPrint/Verbatim.swift b/Sources/SwiftFormat/PrettyPrint/Verbatim.swift index 81ff2749..75be7b2e 100644 --- a/Sources/SwiftFormat/PrettyPrint/Verbatim.swift +++ b/Sources/SwiftFormat/PrettyPrint/Verbatim.swift @@ -11,7 +11,6 @@ //===----------------------------------------------------------------------===// import Foundation -import SwiftFormatConfiguration /// Describes options for behavior when applying the indentation of the current context when /// printing a verbatim token. diff --git a/Sources/SwiftFormat/PrettyPrint/WhitespaceLinter.swift b/Sources/SwiftFormat/PrettyPrint/WhitespaceLinter.swift index 2afb0e5f..088e7ac3 100644 --- a/Sources/SwiftFormat/PrettyPrint/WhitespaceLinter.swift +++ b/Sources/SwiftFormat/PrettyPrint/WhitespaceLinter.swift @@ -10,7 +10,6 @@ // //===----------------------------------------------------------------------===// -import SwiftFormatConfiguration import SwiftSyntax private let utf8Newline = UTF8.CodeUnit(ascii: "\n") diff --git a/Sources/SwiftFormat/Rules/NoAssignmentInExpressions.swift b/Sources/SwiftFormat/Rules/NoAssignmentInExpressions.swift index 3ef70a28..b5996f83 100644 --- a/Sources/SwiftFormat/Rules/NoAssignmentInExpressions.swift +++ b/Sources/SwiftFormat/Rules/NoAssignmentInExpressions.swift @@ -10,7 +10,6 @@ // //===----------------------------------------------------------------------===// -import SwiftFormatConfiguration import SwiftSyntax /// Assignment expressions must be their own statements. diff --git a/Sources/SwiftFormatConfiguration/Compatibility.swift b/Sources/SwiftFormatConfiguration/Compatibility.swift new file mode 100644 index 00000000..3fc58654 --- /dev/null +++ b/Sources/SwiftFormatConfiguration/Compatibility.swift @@ -0,0 +1,19 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift.org open source project +// +// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See https://swift.org/LICENSE.txt for license information +// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// +//===----------------------------------------------------------------------===// + +// Make these symbols that used to live in `SwiftFormatConfiguration` available when that module is +// imported. +// TODO: Remove this after the 509 release. +@_exported import struct SwiftFormat.Configuration +@_exported import struct SwiftFormat.FileScopedDeclarationPrivacyConfiguration +@_exported import struct SwiftFormat.NoAssignmentInExpressionsConfiguration +@_exported import enum SwiftFormat.Indent diff --git a/Sources/_SwiftFormatTestSupport/Configuration+Testing.swift b/Sources/_SwiftFormatTestSupport/Configuration+Testing.swift index 4ba83a45..36cd2971 100644 --- a/Sources/_SwiftFormatTestSupport/Configuration+Testing.swift +++ b/Sources/_SwiftFormatTestSupport/Configuration+Testing.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -import SwiftFormatConfiguration +import SwiftFormat extension Configuration { /// The default configuration to be used during unit tests. diff --git a/Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift b/Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift index 567f5dcc..f7a9b25a 100644 --- a/Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift +++ b/Sources/_SwiftFormatTestSupport/DiagnosingTestCase.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat import SwiftSyntax import XCTest diff --git a/Sources/generate-pipeline/main.swift b/Sources/generate-pipeline/main.swift index fdf93203..fd3c337c 100644 --- a/Sources/generate-pipeline/main.swift +++ b/Sources/generate-pipeline/main.swift @@ -24,7 +24,8 @@ let pipelineFile = sourcesDirectory .appendingPathComponent("Core") .appendingPathComponent("Pipelines+Generated.swift") let ruleRegistryFile = sourcesDirectory - .appendingPathComponent("SwiftFormatConfiguration") + .appendingPathComponent("SwiftFormat") + .appendingPathComponent("Core") .appendingPathComponent("RuleRegistry+Generated.swift") let ruleNameCacheFile = sourcesDirectory diff --git a/Sources/swift-format/Frontend/ConfigurationLoader.swift b/Sources/swift-format/Frontend/ConfigurationLoader.swift index 6948ac55..56154b09 100644 --- a/Sources/swift-format/Frontend/ConfigurationLoader.swift +++ b/Sources/swift-format/Frontend/ConfigurationLoader.swift @@ -11,7 +11,7 @@ //===----------------------------------------------------------------------===// import Foundation -import SwiftFormatConfiguration +import SwiftFormat /// Loads formatter configurations, caching them in memory so that multiple operations in the same /// directory do not repeatedly hit the file system. diff --git a/Sources/swift-format/Frontend/FormatFrontend.swift b/Sources/swift-format/Frontend/FormatFrontend.swift index aac36856..019eb40c 100644 --- a/Sources/swift-format/Frontend/FormatFrontend.swift +++ b/Sources/swift-format/Frontend/FormatFrontend.swift @@ -13,7 +13,6 @@ import Foundation import SwiftDiagnostics import SwiftFormat -import SwiftFormatConfiguration import SwiftSyntax /// The frontend for formatting operations. diff --git a/Sources/swift-format/Frontend/Frontend.swift b/Sources/swift-format/Frontend/Frontend.swift index 0c8c4a50..de62ff4a 100644 --- a/Sources/swift-format/Frontend/Frontend.swift +++ b/Sources/swift-format/Frontend/Frontend.swift @@ -12,7 +12,6 @@ import Foundation import SwiftFormat -import SwiftFormatConfiguration import SwiftSyntax import SwiftParser diff --git a/Sources/swift-format/Frontend/LintFrontend.swift b/Sources/swift-format/Frontend/LintFrontend.swift index 78996017..4ef98982 100644 --- a/Sources/swift-format/Frontend/LintFrontend.swift +++ b/Sources/swift-format/Frontend/LintFrontend.swift @@ -13,7 +13,6 @@ import Foundation import SwiftDiagnostics import SwiftFormat -import SwiftFormatConfiguration import SwiftSyntax /// The frontend for linting operations. diff --git a/Sources/swift-format/Subcommands/DumpConfiguration.swift b/Sources/swift-format/Subcommands/DumpConfiguration.swift index b32b9c8f..9e6f03c4 100644 --- a/Sources/swift-format/Subcommands/DumpConfiguration.swift +++ b/Sources/swift-format/Subcommands/DumpConfiguration.swift @@ -12,7 +12,7 @@ import ArgumentParser import Foundation -import SwiftFormatConfiguration +import SwiftFormat extension SwiftFormatCommand { /// Dumps the tool's default configuration in JSON format to standard output. diff --git a/Tests/SwiftFormatConfigurationTests/ConfigurationTests.swift b/Tests/SwiftFormatTests/API/ConfigurationTests.swift similarity index 96% rename from Tests/SwiftFormatConfigurationTests/ConfigurationTests.swift rename to Tests/SwiftFormatTests/API/ConfigurationTests.swift index 9d50ec38..6834e9f5 100644 --- a/Tests/SwiftFormatConfigurationTests/ConfigurationTests.swift +++ b/Tests/SwiftFormatTests/API/ConfigurationTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat import XCTest final class ConfigurationTests: XCTestCase { diff --git a/Tests/SwiftFormatTests/PrettyPrint/AssignmentExprTests.swift b/Tests/SwiftFormatTests/PrettyPrint/AssignmentExprTests.swift index a1e9452a..77d505be 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/AssignmentExprTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/AssignmentExprTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class AssignmentExprTests: PrettyPrintTestCase { func testBasicAssignmentExprs() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/AttributeTests.swift b/Tests/SwiftFormatTests/PrettyPrint/AttributeTests.swift index d67bc73d..57a12a3a 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/AttributeTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/AttributeTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class AttributeTests: PrettyPrintTestCase { func testAttributeParamSpacing() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/AwaitExprTests.swift b/Tests/SwiftFormatTests/PrettyPrint/AwaitExprTests.swift index 5730f7f4..1c890e42 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/AwaitExprTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/AwaitExprTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class AwaitExprTests: PrettyPrintTestCase { func testBasicAwaits() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/BinaryOperatorExprTests.swift b/Tests/SwiftFormatTests/PrettyPrint/BinaryOperatorExprTests.swift index 54f12e00..50b283bd 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/BinaryOperatorExprTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/BinaryOperatorExprTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class BinaryOperatorExprTests: PrettyPrintTestCase { func testNonRangeFormationOperatorsAreSurroundedByBreaks() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/ClassDeclTests.swift b/Tests/SwiftFormatTests/PrettyPrint/ClassDeclTests.swift index 86f47bf0..a69ffa1f 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/ClassDeclTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/ClassDeclTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class ClassDeclTests: PrettyPrintTestCase { func testBasicClassDeclarations() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/ClosureExprTests.swift b/Tests/SwiftFormatTests/PrettyPrint/ClosureExprTests.swift index 41332f5d..089aee1b 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/ClosureExprTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/ClosureExprTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class ClosureExprTests: PrettyPrintTestCase { func testBasicFunctionClosures_noPackArguments() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/DeclNameArgumentTests.swift b/Tests/SwiftFormatTests/PrettyPrint/DeclNameArgumentTests.swift index f4138d1d..ea7dd2c4 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/DeclNameArgumentTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/DeclNameArgumentTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class DeclNameArgumentTests: PrettyPrintTestCase { func testSelectors_noPackArguments() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/DoStmtTests.swift b/Tests/SwiftFormatTests/PrettyPrint/DoStmtTests.swift index f3c45886..fdb491ad 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/DoStmtTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/DoStmtTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class DoStmtTests: PrettyPrintTestCase { func testBasicDoStmt() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/EnumDeclTests.swift b/Tests/SwiftFormatTests/PrettyPrint/EnumDeclTests.swift index 42935e6e..675d75ed 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/EnumDeclTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/EnumDeclTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class EnumDeclTests: PrettyPrintTestCase { func testBasicEnumDeclarations() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/ExtensionDeclTests.swift b/Tests/SwiftFormatTests/PrettyPrint/ExtensionDeclTests.swift index c8a030c8..f11a1eb5 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/ExtensionDeclTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/ExtensionDeclTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class ExtensionDeclTests: PrettyPrintTestCase { func testBasicExtensionDeclarations() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/FunctionCallTests.swift b/Tests/SwiftFormatTests/PrettyPrint/FunctionCallTests.swift index 7ac04ac3..7f2d10e7 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/FunctionCallTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/FunctionCallTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class FunctionCallTests: PrettyPrintTestCase { func testBasicFunctionCalls_noPackArguments() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/FunctionDeclTests.swift b/Tests/SwiftFormatTests/PrettyPrint/FunctionDeclTests.swift index 2c1646c4..5d94fa5f 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/FunctionDeclTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/FunctionDeclTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class FunctionDeclTests: PrettyPrintTestCase { func testBasicFunctionDeclarations_noPackArguments() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/IfConfigTests.swift b/Tests/SwiftFormatTests/PrettyPrint/IfConfigTests.swift index 6558430e..4f8026ab 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/IfConfigTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/IfConfigTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class IfConfigTests: PrettyPrintTestCase { func testBasicIfConfig() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/IfStmtTests.swift b/Tests/SwiftFormatTests/PrettyPrint/IfStmtTests.swift index 6c5d74b0..cddaad53 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/IfStmtTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/IfStmtTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat import XCTest final class IfStmtTests: PrettyPrintTestCase { diff --git a/Tests/SwiftFormatTests/PrettyPrint/InitializerDeclTests.swift b/Tests/SwiftFormatTests/PrettyPrint/InitializerDeclTests.swift index 0582cfee..d1227605 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/InitializerDeclTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/InitializerDeclTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class InitializerDeclTests: PrettyPrintTestCase { func testBasicInitializerDeclarations_noPackArguments() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/MacroCallTests.swift b/Tests/SwiftFormatTests/PrettyPrint/MacroCallTests.swift index 413190a4..dffbef00 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/MacroCallTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/MacroCallTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class MacroCallTests: PrettyPrintTestCase { func testNoWhiteSpaceAfterMacroWithoutTrailingClosure() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/MacroDeclTests.swift b/Tests/SwiftFormatTests/PrettyPrint/MacroDeclTests.swift index 1cbee43b..2182b9dc 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/MacroDeclTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/MacroDeclTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class MacroDeclTests: PrettyPrintTestCase { func testBasicMacroDeclarations_noPackArguments() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/MemberAccessExprTests.swift b/Tests/SwiftFormatTests/PrettyPrint/MemberAccessExprTests.swift index 3ba49030..6b0ed8cf 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/MemberAccessExprTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/MemberAccessExprTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class MemberAccessExprTests: PrettyPrintTestCase { func testMemberAccess() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/ObjectLiteralExprTests.swift b/Tests/SwiftFormatTests/PrettyPrint/ObjectLiteralExprTests.swift index d8aab962..c735320b 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/ObjectLiteralExprTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/ObjectLiteralExprTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class ObjectLiteralExprTests: PrettyPrintTestCase { func testColorLiteral_noPackArguments() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/OperatorDeclTests.swift b/Tests/SwiftFormatTests/PrettyPrint/OperatorDeclTests.swift index 8272d452..6849fbed 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/OperatorDeclTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/OperatorDeclTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class OperatorDeclTests: PrettyPrintTestCase { func testOperatorDecl() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/PatternBindingTests.swift b/Tests/SwiftFormatTests/PrettyPrint/PatternBindingTests.swift index 264156c3..608825b9 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/PatternBindingTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/PatternBindingTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class PatternBindingTests: PrettyPrintTestCase { func testBindingIncludingTypeAnnotation() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/PrettyPrintTestCase.swift b/Tests/SwiftFormatTests/PrettyPrint/PrettyPrintTestCase.swift index 4bc4e114..570a42a1 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/PrettyPrintTestCase.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/PrettyPrintTestCase.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat import SwiftOperators import SwiftSyntax import SwiftParser diff --git a/Tests/SwiftFormatTests/PrettyPrint/ProtocolDeclTests.swift b/Tests/SwiftFormatTests/PrettyPrint/ProtocolDeclTests.swift index d18864af..d10db6c9 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/ProtocolDeclTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/ProtocolDeclTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class ProtocolDeclTests: PrettyPrintTestCase { func testBasicProtocolDeclarations() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/RepeatStmtTests.swift b/Tests/SwiftFormatTests/PrettyPrint/RepeatStmtTests.swift index d337590f..037c26f3 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/RepeatStmtTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/RepeatStmtTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class RepeatStmtTests: PrettyPrintTestCase { func testBasicRepeatTests_noBreakBeforeWhile() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/RespectsExistingLineBreaksTests.swift b/Tests/SwiftFormatTests/PrettyPrint/RespectsExistingLineBreaksTests.swift index 2bcff38f..86c5e3cd 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/RespectsExistingLineBreaksTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/RespectsExistingLineBreaksTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat /// Sanity checks and regression tests for the `respectsExistingLineBreaks` configuration setting /// in both true and false states. diff --git a/Tests/SwiftFormatTests/PrettyPrint/StructDeclTests.swift b/Tests/SwiftFormatTests/PrettyPrint/StructDeclTests.swift index 42534dae..664fc59d 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/StructDeclTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/StructDeclTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class StructDeclTests: PrettyPrintTestCase { func testBasicStructDeclarations() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/SubscriptDeclTests.swift b/Tests/SwiftFormatTests/PrettyPrint/SubscriptDeclTests.swift index dd693862..9a06c0ba 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/SubscriptDeclTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/SubscriptDeclTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class SubscriptDeclTests: PrettyPrintTestCase { func testBasicSubscriptDeclarations() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/SwitchCaseIndentConfigTests.swift b/Tests/SwiftFormatTests/PrettyPrint/SwitchCaseIndentConfigTests.swift index 3ba650af..b39e36e5 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/SwitchCaseIndentConfigTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/SwitchCaseIndentConfigTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat /// Tests the `indentSwitchCaseLabels` config option final class SwitchCaseIndentConfigTests: PrettyPrintTestCase { diff --git a/Tests/SwiftFormatTests/PrettyPrint/SwitchStmtTests.swift b/Tests/SwiftFormatTests/PrettyPrint/SwitchStmtTests.swift index 15bb3379..6928defd 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/SwitchStmtTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/SwitchStmtTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class SwitchStmtTests: PrettyPrintTestCase { func testBasicSwitch() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/TryCatchTests.swift b/Tests/SwiftFormatTests/PrettyPrint/TryCatchTests.swift index 6c3acaeb..b92a0333 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/TryCatchTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/TryCatchTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat final class TryCatchTests: PrettyPrintTestCase { func testBasicTries() { diff --git a/Tests/SwiftFormatTests/PrettyPrint/WhitespaceLintTests.swift b/Tests/SwiftFormatTests/PrettyPrint/WhitespaceLintTests.swift index 9042cb6f..0000be6a 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/WhitespaceLintTests.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/WhitespaceLintTests.swift @@ -1,5 +1,4 @@ import SwiftFormat -import SwiftFormatConfiguration import _SwiftFormatTestSupport // A note about these tests: `WhitespaceLinter` *only* emits findings; it does not do any diff --git a/Tests/SwiftFormatTests/PrettyPrint/WhitespaceTestCase.swift b/Tests/SwiftFormatTests/PrettyPrint/WhitespaceTestCase.swift index cd0aeed9..1add2343 100644 --- a/Tests/SwiftFormatTests/PrettyPrint/WhitespaceTestCase.swift +++ b/Tests/SwiftFormatTests/PrettyPrint/WhitespaceTestCase.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat import SwiftSyntax import SwiftParser import XCTest diff --git a/Tests/SwiftFormatTests/Rules/FileScopedDeclarationPrivacyTests.swift b/Tests/SwiftFormatTests/Rules/FileScopedDeclarationPrivacyTests.swift index 576f8881..e4113025 100644 --- a/Tests/SwiftFormatTests/Rules/FileScopedDeclarationPrivacyTests.swift +++ b/Tests/SwiftFormatTests/Rules/FileScopedDeclarationPrivacyTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat import SwiftSyntax import _SwiftFormatTestSupport diff --git a/Tests/SwiftFormatTests/Rules/ImportsXCTestVisitorTests.swift b/Tests/SwiftFormatTests/Rules/ImportsXCTestVisitorTests.swift index 1bef3833..7e28f095 100644 --- a/Tests/SwiftFormatTests/Rules/ImportsXCTestVisitorTests.swift +++ b/Tests/SwiftFormatTests/Rules/ImportsXCTestVisitorTests.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat import SwiftParser import XCTest diff --git a/Tests/SwiftFormatTests/Rules/LintOrFormatRuleTestCase.swift b/Tests/SwiftFormatTests/Rules/LintOrFormatRuleTestCase.swift index 523769d2..d249ae21 100644 --- a/Tests/SwiftFormatTests/Rules/LintOrFormatRuleTestCase.swift +++ b/Tests/SwiftFormatTests/Rules/LintOrFormatRuleTestCase.swift @@ -1,4 +1,4 @@ -import SwiftFormatConfiguration +import SwiftFormat import SwiftOperators import SwiftParser import SwiftSyntax