github realm/SwiftLint 0.40.0
0.40.0: Washable Mask

latest releases: 0.54.0, 0.53.0, 0.52.4...
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.
    Amzd
    #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

Don't miss a new SwiftLint release

NewReleases is sending notifications on new releases.