Skip to content

Commit 6d5af5f

Browse files
authored
Enable async_without_await rule (#6104)
1 parent d168785 commit 6d5af5f

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

.swiftlint.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ opt_in_rules:
1616
- all
1717
disabled_rules:
1818
- anonymous_argument_in_multiline_closure
19-
- async_without_await
2019
- conditional_returns_on_newline
2120
- contrasted_opening_brace
2221
- convenience_type

Plugins/SwiftLintBuildToolPlugin/SwiftLintBuildToolPlugin.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ struct SwiftLintBuildToolPlugin: BuildToolPlugin {
66
func createBuildCommands(
77
context: PluginContext,
88
target: Target
9-
) async throws -> [Command] {
9+
) throws -> [Command] {
1010
try makeCommand(executable: context.tool(named: "swiftlint"),
1111
swiftFiles: (target as? SourceModuleTarget).flatMap(swiftFiles) ?? [],
1212
environment: environment(context: context, target: target),

Source/SwiftLintFramework/Configuration+CommandLine.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ private func autoreleasepool<T>(block: () -> T) -> T { block() }
7575

7676
extension Configuration {
7777
func visitLintableFiles(with visitor: LintableFilesVisitor, storage: RuleStorage) async throws -> [SwiftLintFile] {
78-
let files = try await Signposts.record(name: "Configuration.VisitLintableFiles.GetFiles") {
79-
try await getFiles(with: visitor)
78+
let files = try Signposts.record(name: "Configuration.VisitLintableFiles.GetFiles") {
79+
try getFiles(with: visitor)
8080
}
8181
let groupedFiles = try Signposts.record(name: "Configuration.VisitLintableFiles.GroupFiles") {
8282
try groupFiles(files, visitor: visitor)
@@ -236,7 +236,7 @@ extension Configuration {
236236
linters.asyncMap(visit)
237237
}
238238

239-
fileprivate func getFiles(with visitor: LintableFilesVisitor) async throws -> [SwiftLintFile] {
239+
fileprivate func getFiles(with visitor: LintableFilesVisitor) throws -> [SwiftLintFile] {
240240
let options = visitor.options
241241
if options.useSTDIN {
242242
let stdinData = FileHandle.standardInput.readDataToEndOfFile()

Source/swiftlint-dev/Reporters+Register.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extension SwiftLintDev.Reporters {
1818
.appendingPathComponent("Reporters", isDirectory: true)
1919
}
2020

21-
func run() async throws {
21+
func run() throws {
2222
guard FileManager.default.fileExists(atPath: reportersDirectory.path) else {
2323
throw ValidationError("Command must be run from the root of the SwiftLint repository.")
2424
}

Source/swiftlint-dev/Rules+Register.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extension SwiftLintDev.Rules {
2626
.appendingPathComponent("GeneratedTests", isDirectory: true)
2727
}
2828

29-
func run() async throws {
29+
func run() throws {
3030
try runFor(newRule: nil)
3131
}
3232

Source/swiftlint-dev/Rules+Template.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ extension SwiftLintDev.Rules {
4242
@Flag(name: .long, help: "Skip registration.")
4343
var skipRegistration = false
4444

45-
func run() async throws {
45+
func run() throws {
4646
let rootDirectory = URL(fileURLWithPath: FileManager.default.currentDirectoryPath)
4747
let ruleDirectory = rootDirectory
4848
.appendingPathComponent("Source", isDirectory: true)

0 commit comments

Comments
 (0)