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 8773f051f..5445d2ed4 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 6d7045c78..124672571 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 8ab36f0f6..9230bdd8f 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 c891fff3a..4806f19df 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 94cfc5a4b..8851a685c 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 ee85cec48..8e119b819 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 e326894fb..062d50a07 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 6e91d821d..97a1c5fc6 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 d6b09abb8..5d00dd005 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 81ff2749a..75be7b2ea 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 2afb0e5f6..088e7ac38 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 3ef70a287..b5996f831 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 000000000..3fc586541 --- /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 4ba83a450..36cd2971d 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 567f5dccf..f7a9b25a8 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 fdf932031..fd3c337ca 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 6948ac553..56154b090 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 aac36856b..019eb40c0 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 0c8c4a50f..de62ff4ad 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 789960177..4ef989826 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 b32b9c8fe..9e6f03c43 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 9d50ec388..6834e9f55 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 a1e9452a3..77d505be6 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 d67bc73d3..57a12a3a7 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 5730f7f49..1c890e42d 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 54f12e008..50b283bd6 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 86f47bf0f..a69ffa1f5 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 41332f5d7..089aee1ba 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 f4138d1d6..ea7dd2c4a 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 f3c458869..fdb491adb 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 42935e6e5..675d75eda 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 c8a030c84..f11a1eb5b 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 7ac04ac34..7f2d10e7e 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 2c1646c4d..5d94fa5f2 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 6558430e1..4f8026ab4 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 6c5d74b00..cddaad53c 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 0582cfeec..d1227605a 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 413190a41..dffbef001 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 1cbee43b7..2182b9dc4 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 3ba490308..6b0ed8cf5 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 d8aab9620..c735320b4 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 8272d4526..6849fbed2 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 264156c31..608825b96 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 4bc4e1142..570a42a11 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 d18864afe..d10db6c93 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 d337590ff..037c26f31 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 2bcff38f6..86c5e3cde 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 42534dae5..664fc59d6 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 dd6938629..9a06c0bab 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 3ba650afe..b39e36e54 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 15bb33798..6928defd5 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 6c3acaeb8..b92a03338 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 9042cb6f5..0000be6ac 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 cd0aeed90..1add23434 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 576f88811..e41130251 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 1bef38333..7e28f0958 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 523769d26..d249ae216 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