SwiftLint v0.42.0 Release Notes

Release Date: 2020-12-14 // 3 months ago
  • ๐Ÿ’ฅ Breaking

    • ๐Ÿ‘• SwiftLint now requires Swift 5.2 or higher to build.
      JP Simard

    • ๐Ÿ‘• SwiftLintFramework can no longer be integrated as a Carthage depdendency.
      JP Simard #3412

    • ๐Ÿ‘• SwiftLint.xcworkspace and SwiftLint.xcproject have been completely removed. You can still use Xcode to develop SwiftLint by opening it as a Swift Package by typing xed . or xed Package.swift from your shell.
      JP Simard #3412

    • Renamed statement_level to function_level in nesting rule configuration.
      Skoti

    • Separated type_level and function_level counting in nesting rule.
      Skoti #1151

    • 0๏ธโƒฃ function_level in nesting rule defaults to 2 levels.
      Skoti

    • Added check_nesting_in_closures_and_statements in nesting rule to search for nested types and functions within closures and statements. Defaults to true.
      Skoti

    • ๐Ÿ“‡ Renamed OverridenSuperCallConfiguration to OverriddenSuperCallConfiguration.
      Bryan Ricker #3426

    Experimental

    • None.

    โœจ Enhancements

    • Don't report @UIApplicationDelegateAdaptor statements in weak-delegate rule. Richard Turton #3286

    • Don't report unavailable_function violations for functions returning Never.
      Artem Garmash #3286

    • ๐Ÿ‘ Added always_allow_one_type_in_functions option in nesting rule configuration. Defaults to false. This allows to nest one type within a function even if breaking the maximum type_level.
      Skoti #1151

    • Add option to specify a child_config / parent_config file (local or remote) in any SwiftLint configuration file. Allow passing multiple configuration files via the command line. Improve documentation for multiple configuration files.
      Frederick Pietschmann #1352

    • Add an always_keep_imports configuration option for the unused_import rule.
      Keith Smiley

    • โž• Add comment_spacing rule.
      Noah Gilmore #3233

    • โž• Add codeclimate reporter to generate JSON reports in codeclimate format. Could be used for GitLab Code Quality MR Widget.
      jkroepke #3424

    • ๐Ÿ‘ Add an override_allowed_terms configuration parameter to the inclusive_language rule, with a default value of mastercard.
      Dalton Claybrook #3415

    ๐Ÿ› Bug Fixes

    • โœ‚ Remove @IBOutlet and @IBInspectable from UnusedDeclarationRule.
      Keith Smiley #3184

Previous changes from v0.42.0-rc.2

  • ๐Ÿš€ 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/[email protected]
    • ๐Ÿ‘• Cloning and building from source: git clone https://github.com/realm/SwiftLint.git && cd SwiftLint && git checkout 0.42.0-rc.2 && make install

    ๐Ÿ”„ Changes from 0.42.0-rc.1: 0.42.0-rc.1...0.42.0-rc.2


    ๐Ÿ’ฅ Breaking

    ๐Ÿ‘• SwiftLint now requires Swift 5.2 or higher to build.
    JP Simard

    ๐Ÿ‘• SwiftLintFramework can no longer be integrated as a Carthage
    depdendency.
    JP Simard
    ๐Ÿ‘• #3412

    ๐Ÿ‘• SwiftLint.xcworkspace and SwiftLint.xcproject have been completely
    โœ‚ removed. You can still use Xcode to develop SwiftLint by opening it as
    ๐Ÿ“ฆ a Swift Package by typing xed . or xed Package.swift from your
    shell.
    JP Simard
    ๐Ÿ‘• #3412

    Renamed statement_level to function_level in nesting rule
    ๐Ÿ”ง configuration.
    Skoti

    Separated type_level and function_level counting in nesting
    rule.
    Skoti
    ๐Ÿ‘• #1151

    0๏ธโƒฃ function_level in nesting rule defaults to 2 levels.
    Skoti

    Added check_nesting_in_closures_and_statements in nesting rule to
    search for nested types and functions within closures and statements.
    0๏ธโƒฃ Defaults to true.
    Skoti

    ๐Ÿ“‡ Renamed OverridenSuperCallConfiguration to
    OverriddenSuperCallConfiguration.
    Bryan Ricker
    ๐Ÿ‘• #3426

    Experimental

    • None.

    โœจ Enhancements

    Don't report @UIApplicationDelegateAdaptor statements in weak-delegate rule.
    Richard Turton
    ๐Ÿ‘• #3286

    Don't report unavailable_function violations for functions returning
    Never.
    Artem Garmash
    ๐Ÿ‘• #3286

    ๐Ÿ‘ Added always_allow_one_type_in_functions option in nesting rule
    ๐Ÿ”ง configuration. Defaults to false. This allows to nest one type
    within a function even if breaking the maximum type_level.
    Skoti
    ๐Ÿ‘• #1151

    Add option to specify a child_config / parent_config file
    ๐Ÿ‘• (local or remote) in any SwiftLint configuration file.
    ๐Ÿ‘ Allow passing multiple configuration files via the command line.
    ๐Ÿ‘Œ Improve documentation for multiple configuration files.
    Frederick Pietschmann
    ๐Ÿ‘• #1352

    Add an always_keep_imports configuration option for the
    unused_import rule.
    Keith Smiley

    โž• Add comment_spacing rule.
    Noah Gilmore
    ๐Ÿ‘• #3233

    โž• Add codeclimate reporter to generate JSON reports in codeclimate
    format. Could be used for GitLab Code Quality MR Widget.
    jkroepke
    ๐Ÿ‘• #3424

    Add non_private_xctest_member rule.
    Keith Smiley

    ๐Ÿ‘ Add an override_allowed_terms configuration parameter to the
    0๏ธโƒฃ inclusive_language rule, with a default value of mastercard.
    Dalton Claybrook
    ๐Ÿ‘• #3415

    ๐Ÿ› Bug Fixes

    • โœ‚ Remove @IBOutlet and @IBInspectable from UnusedDeclarationRule.
      Keith Smiley
      ๐Ÿ‘• #3184