Breaking
- None.
Experimental
- None.
Enhancements
-
The
SwiftLintPlugin
SwiftPM plugin now uses a prebuilt binary on
macOS.
Tony Arnold
JP Simard
#4558 -
Don't trigger
shorthand_operator
violations inside a shorthand
operator function declaration.
Marcelo Fabri
#4611 -
The
balanced_xctest_lifecycle
,single_test_class
,
empty_xctest_method
andtest_case_accessibility
rules will now be
applied to subclasses ofQuickSpec
, as well asXCTestCase
, by
default.
Martin Redington -
Add
test_parent_classes
option tobalanced_xctest_lifecycle
,
single_test_class
andempty_xctest_method
rules.
Martin Redington
#4200 -
Show warnings in the console for Analyzer rules that are listed in the
opt_in_rules
configuration section.
SimplyDanny
#4612
Bug Fixes
-
Fix configuration parsing error in
unused_declaration
rule.
SimplyDanny
#4612 -
Skip
defer
statements being last in an#if
block if the#if
statement is not itself the last statement in a block.
SimplyDanny
#4615 -
Fix false positives in
empty_enum_arguments
when the called
expression is an identifier or an init call.
Steffen Matthischke
#4597 -
Fix correction issue in
comma
when there was too much whitespace
following the comma.
JP Simard
Using Bazel
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 = "f94e6dddf74739ef5cb30f000e13a2a613f6ebfa5e63588305a71fce8a8a9911",
url = "https://github.com/bazelbuild/rules_apple/releases/download/1.1.3/rules_apple.1.1.3.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 = "b8c4d765bcd8b533fcc2e15f32482a1a17572f143b65af388f7d5ac99994a99a",
url = "https://github.com/realm/SwiftLint/releases/download/0.50.3/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 -c opt @SwiftLint//:swiftlint -- --help