nicklockwood / SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code
MIT License
7.63k stars 623 forks source link

`blankLineAfterImports` rule works incorrectly with `internal` and `private` keywords #1650

Closed smartpie closed 2 months ago

smartpie commented 3 months ago

The blankLineAfterImports rule works incorrectly with internal and private keywords (with all keywords before import, if others exist, I suppose)

For example, this:

internal import UIKit
internal import Base
internal import CoreContent
internal import Implicits
internal import GoogleImportTabHelper
private import CoreDownloads
private import Time
private import WebPageKit

Was turned into that:

internal import UIKit

internal import Base

internal import CoreContent

internal import Implicits

internal import GoogleImportTabHelper

private import CoreDownloads

private import Time

private import WebPageKit
nicklockwood commented 2 months ago

@smartpie fixed in 0.53.6