github realm/SwiftLint 0.58.0
0.58.0: New Year’s Fresh Fold

16 hours ago

Breaking

  • The command plugin now requires write permissions so that it works with the --fix option without an error.
    SimplyDanny

  • The artifact bundle name has changed. SwiftLintBinary-macos.artifactbundle.zip is now called
    SwiftLintBinary.artifactbundle.zip. It now includes an AMD64 Linux binary.
    Bradley Mackey
    #5514

  • The inert_defer and unused_capture_list rules have completely been removed after being deprecated for 2 years.
    SimplyDanny

  • SwiftLint now requires a Swift 5.10 or higher compiler to build. The Swift Package Manager plugins continue to work with Swift 5.9.
    SimplyDanny

  • The private_unit_test rule's deprecated regex configuration option has been removed after 2 years.
    Martin Redington
    #5912

Experimental

  • None.

Enhancements

  • Add Xcode command plugin allowing to run SwiftLint from within Xcode.
    SimplyDanny

  • Add new async_without_await opt-in rule that checks if an async declaration contains at least one await.
    Jan Kolarik
    #5082

  • Support replacing identity expressions with \.self in prefer_key_path rule from Swift 6 on.
    SimplyDanny

  • Support linting only provided file paths with command plugins.
    DanSkeel

  • Add new category for @IBSegueAction to type_contents_order rule.
    dk-talks
    SimplyDanny

  • Add option to disable redundant_discardable_let rule in SwiftUI view bodies.
    SimplyDanny
    #3855

  • Add new redundant_sendable rule that triggers on Sendable conformances of
    types that are implicitly already Sendable due to being actor-isolated. It
    is enabled by default.
    SimplyDanny

  • Improve performance when exclude patterns resolve to a large set of files.
    SimplyDanny
    #5018

Bug Fixes

  • Ignore TipKit's #Rule macro in empty_count rule.
    Ueeek
    #5883

  • Ignore super calls with trailing closures in unneeded_override rule.
    SimplyDanny
    #5886

  • If violations are detected by lint or analyze, still perform an update
    check for new versions of SwiftLint if requested.
    Martin Redington
    #5904


Using Bazel

With bzlmod:

// Pending BCR update
bazel_dep(name = "swiftlint", version = "0.58.0", repo_name = "SwiftLint")

Without bzlmod, put this in your WORKSPACE:

WORKSPACE
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "build_bazel_rules_apple",
    sha256 = "9e26307516c4d5f2ad4aee90ac01eb8cd31f9b8d6ea93619fc64b3cbc81b0944",
    url = "https://github.com/bazelbuild/rules_apple/releases/download/2.2.0/rules_apple.2.2.0.tar.gz",
)

load(
    "@build_bazel_rules_apple//apple:repositories.bzl",
    "apple_rules_dependencies",
)

apple_rules_dependencies()

load(
    "@build_bazel_rules_swift//swift:repositories.bzl",
    "swift_rules_dependencies",
)

swift_rules_dependencies()

load(
    "@build_bazel_rules_swift//swift:extras.bzl",
    "swift_rules_extra_dependencies",
)

swift_rules_extra_dependencies()

http_archive(
    name = "SwiftLint",
    sha256 = "7f069bc44c548896f78b80cdf223643f6f6da5093a934e834dd7f68eaf1d1940",
    url = "https://github.com/realm/SwiftLint/releases/download/0.58.0/bazel.tar.gz",
)

load("@SwiftLint//bazel:repos.bzl", "swiftlint_repos")

swiftlint_repos()

load("@SwiftLint//bazel:deps.bzl", "swiftlint_deps")

swiftlint_deps()

Then you can run SwiftLint in the current directory with this command:

bazel run @SwiftLint//:swiftlint -- --help

Don't miss a new SwiftLint release

NewReleases is sending notifications on new releases.