SwiftLint v0.40.0 Release Notes

Release Date: 2020-08-10 // over 3 years ago
  • ๐Ÿ’ฅ Breaking

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

    • ๐Ÿ‘Œ Improve compile commands json file validation. If you previously provided invalid files or arguments, the command will now abort.
      Keith Smiley

    Experimental

    • None.

    โœจ Enhancements

    • ๐Ÿ‘ JUnit reporter for GitLab artifact:report:junit with better representation of found issues.
      krin-san #3177

    • Add opt-in ibinspectable_in_extension rule to lint against @IBInspectable properties in extensions.
      Keith Smiley

    • Add computed_accessors_order rule to validate the order of get and set accessors in computed properties and subscripts.
      Marcelo Fabri #3158

    • Extend empty_enum_arguments rule to support if case and guard case.
      Zsolt Kovรกcs #3103

    • Add prefer_zero_over_explicit_init opt-in rule to enforce using .zero instead of calling constructor with zero arguments (e.g. CGPoint(x: 0, y: 0)) when using CoreGraphics types.
      Anton Nazarov #3190

    • โž• Add swiftlint docs command to easily open online documentation.
      417-72KI

    • Add unneeded_notification_center_removal rule to warn against using NotificationCenter.removeObserver(self) in deinit since it's not required after iOS 9/macOS 10.11.
      Amzed #2755

    ๐Ÿ› Bug Fixes

    • ๐Ÿ›  Fix UnusedImportRule breaking transitive imports.
      keith

    • ๐Ÿ›  Fix severity level configuration for duplicate_imports.
      Yusuke Goto

    • Fixes false positives for multiline_parameters_brackets and multiline_arguments_brackets.
      Noah Gilmore #3167

    • Fix conflict of 'opening_brace' with 'implicit_return' for functions implicitly returning a closure.
      SimplyDanny #3034

    • Fix false positive on switch_case_on_newline rule with do/catch statements when using Swift 5.3.
      Marcelo Fabri #3253

    • ๐Ÿ›  Fix false positive uppercase enum case in raw_value_for_camel_cased_codable_enum rule.
      Teameh

    • Fix false positive in no_space_in_method_call rule with multiple trailing closures (Swift 5.3).
      Marcelo Fabri #3259

    • ๐Ÿ›  Fix false negative in explicit_acl rule when using extension with Swift 5.2+.
      Marcelo Fabri #3186

    • closure_parameter_position now triggers in closures that are not inside a function call and also validates captured variables.
      Marcelo Fabri #3225

    • ๐Ÿ›  Fix some cases where the output would be incomplete when running SwiftLint on Linux.
      Marcelo Fabri #3214

    • compiler_protocol_init now triggers on IndexSet(arrayLiteral:).
      Janak Shah #3284

    • Fix false positives in extension_access_modifier rule when using Swift 5.2.
      Marcelo Fabri #3150