realm/SwiftLint

Feature request: lexicographic sorting options for `sorted_imports`

Open

#4.810 geöffnet am 11. März 2023

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Swift (2.295 Forks)batch import
enhancementgood first issue

Repository-Metriken

Stars
 (19.570 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 16T 3h) (37 gemergte PRs in 30 T)

Beschreibung

New Issue Checklist

Describe the bug

import AppTypes
import AVFoundation
import Base
import Logging

Will pass sorted_imports, but swift-format's equivalent of this rule wants lexicographic sorting, and expects

import AppTypes
import Base
import Logging
import AVFoundation

It would be nice if SwiftLint offered a configuration option that preferred a sort order compatible with swift-format

Complete output when running SwiftLint, including the stack trace and command used

N/A

Environment

  • SwiftLint version (run swiftlint version to be sure)? 0.50.3
  • Installation method used (Homebrew, CocoaPods, building from source, etc)? Homebrew
  • Paste your configuration file:

none

no

  • Which Xcode version are you using (check xcodebuild -version)?
Xcode 14.2
Build version 14C18
  • Do you have a sample that shows the issue? Run echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules to quickly test if your example is really demonstrating the issue. If your example is more complex, you can use swiftlint lint --path [file here] --no-cache --enable-all-rules.

N/A

Contributor Guide