Skip to content

Commit

Permalink
Fix blankLineAfterImports for @preconcurrency attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed Nov 4, 2023
1 parent 5455a18 commit a22fbc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Rules.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ public struct _FormatRules {
switch formatter.tokens[nextIndex] {
case .linebreak, .keyword("import"), .keyword("@testable"),
.keyword("@_exported"), .keyword("@_implementationOnly"),
.keyword("@_spi"), .keyword("@_spiOnly"),
.keyword("@_spi"), .keyword("@_spiOnly"), .keyword("@preconcurrency"),
.keyword("#else"), .keyword("#elseif"), .endOfScope("#endif"):
break
default:
Expand Down
2 changes: 2 additions & 0 deletions Tests/RulesTests+Linebreaks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ class LinebreakTests: RulesTests {
@_implementationOnly import ModuleF
@_spi(SPI) import ModuleG
@_spiOnly import ModuleH
@preconcurrency import ModuleI
class foo {}
"""
let output = """
Expand All @@ -417,6 +418,7 @@ class LinebreakTests: RulesTests {
@_implementationOnly import ModuleF
@_spi(SPI) import ModuleG
@_spiOnly import ModuleH
@preconcurrency import ModuleI
class foo {}
"""
Expand Down

0 comments on commit a22fbc3

Please sign in to comment.