Skip to content

Releases: realm/SwiftLint

0.49.0: Asynchronous Defuzzer

26 Aug 14:53
ef36201
Compare
Choose a tag to compare

Note: The default branch for the SwiftLint git repository will be renamed from
master to main on September 1st. Please update any code or automation
accordingly.

Breaking

  • SwiftLint now requires Swift 5.6 or higher to build, and macOS 12
    or higher to run.
    JP Simard

  • Code Climate reports now use SHA256 strings as the issue fingerprint
    values.
    JP Simard

  • Make comma_inheritance an opt-in rule.
    Steve Madsen
    #4027

  • The autocorrect command that was deprecated in 0.43.0 has now been
    completely removed. Use --fix instead.
    JP Simard

  • Remove the AutomaticTestableRule protocol. All examples listed in rules are
    now tested automatically to make sure they are correct.
    SimplyDanny

  • Deprecate the --in-process-sourcekit command line flag. SwiftLint now always
    uses an in-process SourceKit.
    JP Simard

Experimental

  • None.

Enhancements

  • Make duplicate_imports rule correctable. Fix duplicate_imports rule
    reporting redundant violations when more than one duplicate is present.
    Timofey Solonin

  • Support for building SwiftLint with bazel.
    JP Simard

  • Support for writing custom private native rules when building with
    bazel.
    JP Simard
    Keith Smiley
    #3516

  • Make comma rule about 10x faster, finding some previously missed cases and
    fixing some previously wrong corrections.
    JP Simard

  • Make colon rule about 7x faster, finding some previously missed cases.
    JP Simard

  • Make closure_spacing rule about 9x faster, finding some previously missed
    cases and fixing some previously wrong corrections.
    JP Simard
    SimplyDanny
    #4090

  • Introduce new configuration option include_compiler_directives (true by
    default) for the indentation_width rule that allows to ignore compiler
    directives in the indentation analysis. This is especially useful if one (or
    a formatter) prefers to have compiler directives always at the very beginning
    of a line.
    SimplyDanny
    #4030

  • Enable (recursive) globs in included file paths.
    sarastro-nl

  • Custom rules are now broken down per rule instead of in aggregate in
    --benchmark.
    JP Simard

  • The version command now has an optional --verbose flag that prints out the
    full version info, notably the build ID, which can be used to determine if two
    swiftlint executables are identical.
    JP Simard

  • Update documentation for multiline_arguments_brackets and
    multiline_literal_brackets to make it immediately obvious that common
    examples will trigger.
    chrisjf
    #4060

  • The --compile-commands argument can now parse SwiftPM yaml files produced
    when running swift build at .build/{debug,release}.yaml.
    JP Simard

  • Add new configuration option allowed_no_space_operators to
    operator_usage_whitespace rule. It allows to specify custom operators which
    shall not be considered by the rule.
    imben123

  • Add new protocols to remove some boilerplate involved in writing
    SwiftSyntax-based rules.
    JP Simard

Bug Fixes

  • Fix false positive in self_in_property_initialization rule when using
    closures inside didSet and other accessors.
    Marcelo Fabri
    #4041

  • Fix false positive in Duplicated Key in Dictionary Literal Violation rule
    when using keys that are generated at runtime with the same source code.
    OrEliyahu
    #4012

  • Fix false positive in yoda_condition rule by basing it on SwiftSyntax.
    SimplyDanny
    #4081

  • Fix false negatives in first_where rule when filtering array of dictionaries
    with String keys.
    KS1019

  • Fix broken correction for explicit_init rule.
    KS1019


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 = "f003875c248544009c8e8ae03906bbdacb970bc3e5931b40cd76cadeded99632",
    url = "https://github.com/bazelbuild/rules_apple/releases/download/1.1.0/rules_apple.1.1.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 = "ec566314e9220ff681ddb639d3a0532834f66f7e733f5a59c7390469dcb5bd3e",
    url = "https://github.com/realm/SwiftLint/releases/download/0.49.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

0.49.0-rc.2: Asynchronous Defuzzer

18 Aug 17:36
dd55f59
Compare
Choose a tag to compare
Pre-release

This is a prerelease version. It won't be published to Homebrew or CocoaPods. But there are many other ways to install:

  • Downloading the attached SwiftLint.pkg installer and launching it
  • Downloading the attached portable_swiftlint.zip archive, extracting it and moving the binary from portable_swiftlint/swiftlint to /usr/local/bin or elsewhere in your PATH
  • Using Mint: mint install realm/SwiftLint@0.49.0-rc.2
  • Cloning and building from source: git clone https://github.com/realm/SwiftLint.git && cd SwiftLint && git checkout 0.49.0-rc.2 && make install
  • Docker: docker run -it -v `pwd`:`pwd` -w `pwd` ghcr.io/realm/swiftlint:0.49.0-rc.2
  • Bazel: See instructions at the bottom

Changes from 0.48.0: 0.48.0...0.49.0-rc.2
Changes from 0.49.0-rc.1: 0.49.0-rc.1...0.49.0-rc.2


Note: The default branch for the SwiftLint git repository will be renamed from
master to main on September 1st. Please update any code or automation
accordingly.

Breaking

  • SwiftLint now requires Swift 5.6 or higher to build, and macOS 12
    or higher to run.
    JP Simard

  • Code Climate reports now use SHA256 strings as the issue fingerprint
    values.
    JP Simard

  • Make comma_inheritance an opt-in rule.
    Steve Madsen
    #4027

  • The autocorrect command that was deprecated in 0.43.0 has now been
    completely removed. Use --fix instead.
    JP Simard

  • Remove the AutomaticTestableRule protocol. All examples listed in rules are
    now tested automatically to make sure they are correct.
    SimplyDanny

  • Deprecate the --in-process-sourcekit command line flag. SwiftLint now always
    uses an in-process SourceKit.
    JP Simard

Experimental

  • None.

Enhancements

  • Make duplicate_imports rule correctable. Fix duplicate_imports rule
    reporting redundant violations when more than one duplicate is present.
    Timofey Solonin

  • Support for building SwiftLint with bazel.
    JP Simard

  • Support for writing custom private native rules when building with
    bazel.
    JP Simard
    Keith Smiley
    #3516

  • Make comma rule about 10x faster, finding some previously missed cases and
    fixing some previously wrong corrections.
    JP Simard

  • Make colon rule about 7x faster, finding some previously missed cases.
    JP Simard

  • Make closure_spacing rule about 9x faster, finding some previously missed
    cases and fixing some previously wrong corrections.
    JP Simard
    SimplyDanny
    #4090

  • Introduce new configuration option include_compiler_directives (true by
    default) for the indentation_width rule that allows to ignore compiler
    directives in the indentation analysis. This is especially useful if one (or
    a formatter) prefers to have compiler directives always at the very beginning
    of a line.
    SimplyDanny
    #4030

  • Enable (recursive) globs in included file paths.
    sarastro-nl

  • Custom rules are now broken down per rule instead of in aggregate in
    --benchmark.
    JP Simard

  • The version command now has an optional --verbose flag that prints out the
    full version info, notably the build ID, which can be used to determine if two
    swiftlint executables are identical.
    JP Simard

  • Update documentation for multiline_arguments_brackets and
    multiline_literal_brackets to make it immediately obvious that common
    examples will trigger.
    chrisjf
    #4060

Bug Fixes

  • Fix false positive in self_in_property_initialization rule when using
    closures inside didSet and other accessors.
    Marcelo Fabri
    #4041

  • Fix false positive in Duplicated Key in Dictionary Literal Violation rule
    when using keys that are generated at runtime with the same source code.
    OrEliyahu
    #4012

  • Fix false positive in yoda_condition rule by basing it on SwiftSyntax.
    SimplyDanny
    #4081

  • Fix false negatives in first_where rule when filtering array of dictionaries
    with String keys.
    KS1019

  • Fix broken correction for explicit_init rule.
    KS1019


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 = "36072d4f3614d309d6a703da0dfe48684ec4c65a89611aeb9590b45af7a3e592",
    url = "https://github.com/bazelbuild/rules_apple/releases/download/1.0.1/rules_apple.1.0.1.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 = "d34bf123e6380a7527ee78c5f6ec7ede5e00e8c39a9c3b394f590374f566c57d",
    url = "https://github.com/realm/SwiftLint/releases/download/0.49.0-rc.2/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

0.49.0-rc.1: Asynchronous Defuzzer

12 Aug 13:51
6f03036
Compare
Choose a tag to compare
Pre-release

This is a prerelease version. It won't be published to Homebrew or CocoaPods. But there are many other ways to install:

  • Downloading the attached SwiftLint.pkg installer and launching it
  • Downloading the attached portable_swiftlint.zip archive, extracting it and moving the binary from portable_swiftlint/swiftlint to /usr/local/bin or elsewhere in your PATH
  • Using Mint: mint install realm/SwiftLint@0.49.0-rc.1
  • Cloning and building from source: git clone https://github.com/realm/SwiftLint.git && cd SwiftLint && git checkout 0.49.0-rc.1 && make install
  • Docker: docker run -it -v `pwd`:`pwd` -w `pwd` ghcr.io/realm/swiftlint:0.49.0-rc.1
  • Bazel: See instructions at the bottom

Changes from 0.48.0: 0.48.0...0.49.0-rc.1


Note: The default branch for the SwiftLint git repository will be renamed from
master to main on September 1st. Please update any code or automation
accordingly.

Breaking

  • SwiftLint now requires Swift 5.6 or higher to build, and macOS 12
    or higher to run.
    JP Simard

  • Code Climate reports now use SHA256 strings as the issue fingerprint
    values.
    JP Simard

  • Make comma_inheritance an opt-in rule.
    Steve Madsen
    #4027

  • The autocorrect command that was deprecated in 0.43.0 has now been
    completely removed. Use --fix instead.
    JP Simard

  • Remove the AutomaticTestableRule protocol. All examples listed in rules are
    now tested automatically to make sure they are correct.
    SimplyDanny

  • Deprecate the --in-process-sourcekit command line flag. SwiftLint now always
    uses an in-process SourceKit.
    JP Simard

Experimental

  • None.

Enhancements

  • Make duplicate_imports rule correctable. Fix duplicate_imports rule
    reporting redundant violations when more than one duplicate is present.
    Timofey Solonin

  • Support for building SwiftLint with bazel.
    JP Simard

  • Support for writing custom private native rules when building with
    bazel.
    JP Simard
    Keith Smiley
    #3516

  • Make comma rule about 10x faster, finding some previously missed cases and
    fixing some previously wrong corrections.
    JP Simard

  • Make colon rule about 7x faster, finding some previously missed cases.
    JP Simard

  • Introduce new configuration option include_compiler_directives (true by
    default) for the indentation_width rule that allows to ignore compiler
    directives in the indentation analysis. This is especially useful if one (or
    a formatter) prefers to have compiler directives always at the very beginning
    of a line.
    SimplyDanny
    #4030

Bug Fixes

  • Fix false positive in self_in_property_initialization rule when using
    closures inside didSet and other accessors.
    Marcelo Fabri
    #4041

  • Fix false positive in Duplicated Key in Dictionary Literal Violation rule
    when using keys that are generated at runtime with the same source code.
    OrEliyahu
    #4012


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 = "36072d4f3614d309d6a703da0dfe48684ec4c65a89611aeb9590b45af7a3e592",
    url = "https://github.com/bazelbuild/rules_apple/releases/download/1.0.1/rules_apple.1.0.1.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 = "e954f4483f7f4cf523896693ee3505585f6beb0f791e362b42d9bdbb615f051a",
    url = "https://github.com/realm/SwiftLint/releases/download/0.49.0-rc.1/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

0.48.0: Rechargeable Defuzzer

26 Jul 07:34
22fb9eb
Compare
Choose a tag to compare

This is the last release to support building with Swift 5.5.x and running on
macOS < 12.

Breaking

  • Deprecate the --path options for lint/analyze commands. Prefer the
    positional paths that can be added last to both commands.
    SimplyDanny

Experimental

  • None.

Enhancements

  • Support iOSApplicationExtension, macOSApplicationExtension,
    watchOSApplicationExtension, and tvOSApplicationExtension identifiers
    in the deployment_target rule. To configure the rule for these identifiers,
    you need to use the keys iOSApplicationExtension_deployment_target,
    macOSApplicationExtension_deployment_target,
    watchOSApplicationExtension_deployment_target, and
    tvOSApplicationExtension_deployment_target. Extentions default to
    their counterparts unless they are explicitly defined.
    tahabebek
    #4004

  • Rewrite operator_usage_whitespace rule using SwiftSyntax, fixing
    false positives and false negatives.
    Note that this rule doesn't catch violations around return arrows (->)
    anymore - they are already handled by return_arrow_whitespace.
    Marcelo Fabri
    #3965
    #3668
    #2728

  • Support arrays for the included and excluded options when defining
    a custom rule.
    Marcelo Fabri

  • Add back void_function_in_ternary opt-in rule to warn against using
    a ternary operator to call Void functions.
    Marcelo Fabri

  • Support UIEdgeInsets type in prefer_zero_over_explicit_init rule.
    KokiHirokawa
    #3986

Bug Fixes

  • Ignore array types in syntactic_sugar rule if their associated Index is
    accessed.
    SimplyDanny
    #3502

  • Prevent crash for private types named _ in type_name rules.
    sinoru
    #3971

  • Make for_where rule implementation independent of order in structure
    dictionary. This fixes the rule in Xcode 13.3 where some violation were
    no longer reported.
    SimplyDanny
    #3975

  • Update result builder methods in unused_declaration rule fixing some
    false-positives.
    SimplyDanny

  • Look for call expressions which are not wrapped into an argument when
    checking for nested (possibly multiline) arguments fixing some
    false-negatives in (at least) Xcode 13.2.
    SimplyDanny
    #3975

  • Make sure that include paths prefixed with the name of the original path
    are included in the analysis.
    SimplyDanny
    #3705

  • Do not trigger unavailable_condition rule if other #(un)available
    checks are involved.
    SimplyDanny
    #3985

  • Update nimble_operator to support the operators for beNil().
    CraigSiemens

  • Avoid false-positive in let_var_whitespace rule by allowing custom
    attributes on lines directly before let/var declarations.
    SimplyDanny
    #2980

0.47.1: Smarter Appliance

25 Apr 15:31
e497f1f
Compare
Choose a tag to compare

Breaking

  • None.

Experimental

  • None.

Enhancements

  • Add type-checked analyzer rule version of ArrayInitRule named
    TypesafeArrayInitRule with identifier typesafe_array_init that
    avoids the false positives present in the lint rule.
    SimplyDanny
    #3749

  • Add the --in-process-sourcekit command line flag to lint and analyze
    commands, which has the same effect as setting the IN_PROCESS_SOURCEKIT
    environment variable.
    Juozas Valancius

  • Add a new artifactbundle release asset containing swiftlint binaries for
    x86 & arm64 macOS.
    Juozas Valancius
    #3840

  • Add back return_value_from_void_function opt-in rule to warn against using
    return <expression> in a function that returns Void.
    Marcelo Fabri

  • Don't skip autocorrect on files that have parser warnings. Only files with
    errors reported by the Swift parser will be skipped.
    Marcelo Fabri
    #3343

  • Add accessibility_label_for_image rule to warn if a SwiftUI
    Image does not have an accessibility label and is not hidden from
    accessibility.
    Ryan Cole

  • Add unavailable_condition rule to prefer using if #unavailable instead of
    if #available with an empty body and an else condition when using
    Swift 5.6 or later.
    Marcelo Fabri
    #3897

  • Add comma_inheritance rule to validate that inheritance clauses use commas
    instead of &.
    Marcelo Fabri
    #3950

Bug Fixes

  • Fix false positives in unused_closure_parameter when using parameters with
    backticks.
    JP Simard
    #3628

  • Improved the syntactic_sugar rule's detection accuracy and fixed some
    corrections leading to invalid code.
    Paul Taykalo
    #3866

  • Fix analyzer rules with Xcode 13.3 / Swift 5.6. Note that we've measured
    performance regressions compared to Swift 5.5 on the order of about 2x.
    JP Simard
    #3920

  • Error by default on bad expiring todo date formatting.
    Christopher Hale
    #3636

  • Lint/analyze all files listed in the command even if the --path option is
    used.
    coffmark

0.47.0: Smart Appliance

23 Mar 14:59
e5791ec
Compare
Choose a tag to compare

Breaking

  • SwiftLint now requires Swift 5.5 or higher to build.
    JP Simard

  • The SwiftLintFramework podspec has been removed. To our knowledge, this was
    completely unused by other projects and was not worth the complexity needed
    to justify its continued maintenance, especially in light of the integration
    of SwiftSyntax. The SwiftLint podspec is still supported.
    JP Simard

  • SwiftLint now requires at least Swift 5.0 installed in order to lint files.
    Marcelo Fabri

Experimental

  • The force_cast rule and the comment command parsing mechanism have been
    updated to use SwiftSyntax instead of SourceKit. Please report any problems
    you encounter by opening a GitHub issue. If this is successful, more rules may
    use Swift Syntax in the future.
    JP Simard

Enhancements

  • Empty files no longer trigger any violations.
    JP Simard
    #3854

  • Support recursive globs.
    funzin
    JP Simard
    #3789
    #3891

  • The legacy_random rule is now enabled by default.
    Marcelo Fabri

  • The deployment_target rule now supports the #unavailable syntax
    added in Swift 5.6.
    Marcelo Fabri
    #3896

  • Set the IN_PROCESS_SOURCEKIT environment variable, which will use
    the in-process version of sourcekitd on macOS when Xcode 13 or later is
    selected. This avoids the use of XPC, which is prohibited in some sandboxed
    environments, such as in Swift Package Manager plugins.
    Juozas Valancius

  • Add ability to run only one (focused) example.
    PaulTaykalo
    #3911

Bug Fixes

  • Extend class_delegate_protocol to correctly identify cases with the protocol
    body opening brace on a new line.
    Tobisaninfo

  • Fix SwiftLint.pkg installer installing multiple copies of SwiftLint.
    JP Simard
    #3815
    #3887

0.47.0-rc.4: Smart Appliance

18 Mar 23:07
40c1ed3
Compare
Choose a tag to compare
Pre-release

This is a prerelease version. It won't be published to Homebrew or CocoaPods. But there are many other ways to install:

  • Downloading the attached SwiftLint.pkg installer and launching it
  • Downloading the attached portable_swiftlint.zip archive, extracting it and moving the binary from portable_swiftlint/swiftlint to /usr/local/bin or elsewhere in your PATH
  • Using Mint: mint install realm/SwiftLint@0.47.0-rc.4
  • Cloning and building from source: git clone https://github.com/realm/SwiftLint.git && cd SwiftLint && git checkout 0.47.0-rc.4 && make install
  • Docker: docker run -it -v `pwd`:`pwd` -w `pwd` ghcr.io/realm/swiftlint:0.47.0-rc.4

Changes from 0.46.5: 0.46.5...0.47.0-rc.4
Changes from 0.47.0-rc.3: 0.47.0-rc.3...0.47.0-rc.4

Breaking

  • SwiftLint now requires Swift 5.5 or higher to build.
    JP Simard

  • The SwiftLintFramework podspec has been removed. To our knowledge, this was
    completely unused by other projects and was not worth the complexity needed
    to justify its continued maintenance, especially in light of the integration
    of SwiftSyntax. The SwiftLint podspec is still supported.
    JP Simard

  • SwiftLint now requires at least Swift 5.0 installed in order to lint files.
    Marcelo Fabri

Experimental

  • The force_cast rule and the comment command parsing mechanism have been
    updated to use SwiftSyntax instead of SourceKit. Please report any problems
    you encounter by opening a GitHub issue. If this is successful, more rules may
    use Swift Syntax in the future.
    JP Simard

Enhancements

  • Empty files no longer trigger any violations.
    JP Simard
    #3854

  • Support recursive globs.
    funzin
    JP Simard
    #3789
    #3891

  • The legacy_random rule is now enabled by default.
    Marcelo Fabri

  • The deployment_target rule now supports the #unavailable syntax
    added in Swift 5.6.
    Marcelo Fabri
    #3896

  • Set the IN_PROCESS_SOURCEKIT environment variable, which will use
    the in-process version of sourcekitd on macOS when Xcode 13 or later is
    selected. This avoids the use of XPC, which is prohibited in some sandboxed
    environments, such as in Swift Package Manager plugins.
    Juozas Valancius

Bug Fixes

  • Extend class_delegate_protocol to correctly identify cases with the protocol
    body opening brace on a new line.
    Tobisaninfo

  • Fix SwiftLint.pkg installer installing multiple copies of SwiftLint.
    JP Simard
    #3815
    #3887

0.47.0-rc.3: Smart Appliance

17 Mar 19:04
de5114a
Compare
Choose a tag to compare
Pre-release

This is a prerelease version. It won't be published to Homebrew or CocoaPods. But there are many other ways to install:

  • Downloading the attached SwiftLint.pkg installer and launching it
  • Downloading the attached portable_swiftlint.zip archive, extracting it and moving the binary from portable_swiftlint/swiftlint to /usr/local/bin or elsewhere in your PATH
  • Using Mint: mint install realm/SwiftLint@0.47.0-rc.3
  • Cloning and building from source: git clone https://github.com/realm/SwiftLint.git && cd SwiftLint && git checkout 0.47.0-rc.3 && make install
  • Docker: docker run -it -v `pwd`:`pwd` -w `pwd` ghcr.io/realm/swiftlint:0.47.0-rc.3

Changes from 0.46.5: 0.46.5...0.47.0-rc.3
Changes from 0.47.0-rc.2: 0.47.0-rc.2...0.47.0-rc.3

Breaking

  • SwiftLint now requires Swift 5.5 or higher to build.
    JP Simard

  • The SwiftLintFramework podspec has been removed. To our knowledge, this was
    completely unused by other projects and was not worth the complexity needed
    to justify its continued maintenance, especially in light of the integration
    of SwiftSyntax. The SwiftLint podspec is still supported.
    JP Simard

  • SwiftLint now requires at least Swift 5.0 installed in order to lint files.
    Marcelo Fabri

Experimental

  • The force_cast rule and the comment command parsing mechanism have been
    updated to use SwiftSyntax instead of SourceKit. Please report any problems
    you encounter by opening a GitHub issue. If this is successful, more rules may
    use Swift Syntax in the future.
    JP Simard

Enhancements

  • Empty files no longer trigger any violations.
    JP Simard
    #3854

  • Support recursive globs.
    funzin
    JP Simard
    #3789
    #3891

  • The legacy_random rule is now enabled by default.
    Marcelo Fabri

  • The deployment_target rule now supports the #unavailable syntax
    added in Swift 5.6.
    Marcelo Fabri
    #3896

  • SwiftSyntax has been updated to its Swift 5.6 release and may improve parsing
    of Swift 5.6 code.
    JP Simard

  • Add IN_PROCESS_SOURCEKIT environment variable, which uses
    the in-process version of sourcekitd on macOS when Xcode 13 or later is
    selected. This avoids the use of XPC, which is prohibited in some sandboxed
    environments, such as in Swift Package Manager plugins.
    Juozas Valancius

Bug Fixes

  • Extend class_delegate_protocol to correctly identify cases with the protocol
    body opening brace on a new line.
    Tobisaninfo

  • Fix SwiftLint.pkg installer installing multiple copies of SwiftLint.
    JP Simard
    #3815
    #3887

0.47.0-rc.2: Smart Appliance

16 Mar 14:37
67da5a0
Compare
Choose a tag to compare
Pre-release

This is a prerelease version. It won't be published to Homebrew or CocoaPods. But there are many other ways to install:

  • Downloading the attached SwiftLint.pkg installer and launching it
  • Downloading the attached portable_swiftlint.zip archive, extracting it and moving the binary from portable_swiftlint/swiftlint to /usr/local/bin or elsewhere in your PATH
  • Using Mint: mint install realm/SwiftLint@0.47.0-rc.2
  • Cloning and building from source: git clone https://github.com/realm/SwiftLint.git && cd SwiftLint && git checkout 0.47.0-rc.2 && make install
  • Docker: docker run -it -v `pwd`:`pwd` -w `pwd` ghcr.io/realm/swiftlint:0.47.0-rc.2

Changes from 0.46.5: 0.46.5...0.47.0-rc.2
Changes from 0.47.0-rc.1: 0.47.0-rc.1...0.47.0-rc.2

Breaking

  • SwiftLint now requires Swift 5.5 or higher to build.
    JP Simard

  • The SwiftLintFramework podspec has been removed. To our knowledge, this was
    completely unused by other projects and was not worth the complexity needed
    to justify its continued maintenance, especially in light of the integration
    of SwiftSyntax. The SwiftLint podspec is still supported.
    JP Simard

  • SwiftLint now requires at least Swift 5.0 installed in order to lint files.
    Marcelo Fabri

Experimental

  • The force_cast rule and the comment command parsing mechanism have been
    updated to use SwiftSyntax instead of SourceKit. Please report any problems
    you encounter by opening a GitHub issue. If this is successful, more rules may
    use Swift Syntax in the future.
    JP Simard

Enhancements

  • Empty files no longer trigger any violations.
    JP Simard
    #3854

  • Support recursive globs.
    funzin
    JP Simard
    #3789
    #3891

  • The legacy_random rule is now enabled by default.
    Marcelo Fabri

  • The deployment_target rule now supports the #unavailable syntax
    added in Swift 5.6.
    Marcelo Fabri
    #3896

  • Add IN_PROCESS_SOURCEKIT environment variable, which uses
    the in-process version of sourcekitd on macOS when Xcode 13 or later is
    selected. This avoids the use of XPC, which is prohibited in some sandboxed
    environments, such as in Swift Package Manager plugins.
    Juozas Valancius

Bug Fixes

  • Extend class_delegate_protocol to correctly identify cases with the protocol
    body opening brace on a new line.
    Tobisaninfo

  • Fix SwiftLint.pkg installer installing multiple copies of SwiftLint.
    JP Simard
    #3815
    #3887

0.47.0-rc.1: Smart Appliance

09 Mar 02:13
fe8aa19
Compare
Choose a tag to compare
Pre-release

This is a prerelease version. It won't be published to Homebrew or CocoaPods. But there are many other ways to install:

  • Downloading the attached SwiftLint.pkg installer and launching it
  • Downloading the attached portable_swiftlint.zip archive, extracting it and moving the binary from portable_swiftlint/swiftlint to /usr/local/bin or elsewhere in your PATH
  • Using Mint: mint install realm/SwiftLint@0.47.0-rc.1
  • Cloning and building from source: git clone https://github.com/realm/SwiftLint.git && cd SwiftLint && git checkout 0.47.0-rc.1 && make install
  • Docker: docker run -it -v `pwd`:`pwd` -w `pwd` ghcr.io/realm/swiftlint:0.47.0-rc.1

Changes from 0.46.5: 0.46.5...0.47.0-rc.1

Breaking

  • SwiftLint now requires Swift 5.5 or higher to build.
    JP Simard

  • The SwiftLintFramework podspec has been removed. To our knowledge, this was
    completely unused by other projects and was not worth the complexity needed
    to justify its continued maintenance, especially in light of the integration
    of SwiftSyntax. The SwiftLint podspec is still supported.
    JP Simard

Experimental

  • The force_cast rule and the comment command parsing mechanism have been
    updated to use SwiftSyntax instead of SourceKit. Please report any problems
    you encounter by opening a GitHub issue. If this is successful, more rules may
    use Swift Syntax in the future.
    JP Simard