github realm/SwiftLint 0.52.4
0.52.4: Lid Switch

latest releases: 0.57.0, 0.56.2, 0.56.1...
16 months ago

Breaking

  • None.

Experimental

  • None.

Enhancements

  • Handle static spec methods in quick_discouraged_call rule. The method
    type changed from an instance method to a class method in Quick 7.
    SimplyDanny
    #5072

  • Prettify the rule configuration presentation on the command line as well as
    on the website.
    SimplyDanny

Bug Fixes

  • Fix false positives for the unneeded_synthesized_initializer rule, when
    no argument initializers had side-effects.
    Martin Redington
    #5075

  • Ignore switch expressions assigned to variables in switch_case_alignment
    rule.
    SimplyDanny
    #5080

  • Fix auto-correction for the direct_return rule, when statements have
    trailing comments.
    Martin Redington
    #5081

  • Fix false positives for the private_subject rule when creating subjects
    inside initializers.
    kasrababaei

  • Fix false positive for prefer_self_in_static_references when a class
    inherits from another class with generic types.
    kasrababaei


Using Bazel

With bzlmod:

// Pending BCR update: https://github.com/bazelbuild/bazel-central-registry/pull/750
bazel_dep(name = "swiftlint", version = "0.52.4", 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 = "c6ea58b9c72082cdc1ada4a2d48273ecc355896ed72204cedcc586b6ccb8aca6",
    url = "https://github.com/realm/SwiftLint/releases/download/0.52.4/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.