SwiftLint v0.16.0 Release Notes

  • πŸ’₯ Breaking
    • Several API breaking changes were made to conform to the Swift 3 API Design Guidelines. We apologize for any inconvenience this may have caused.
    ✨ Enhancements
    • πŸ‘• Speed up linting by caching linter results across invocations.
      Marcelo Fabri #868

    • πŸ‘• Speed up linting by processing multiple files and rules concurrently.
      JP Simard #1077

    • πŸ‘• Make many operations in SwiftLintFramework safe to call in multithreaded scenarios, including accessing Linter.styleViolations.
      JP Simard #1077

    • Permit unsigned and explicitly-sized integer types in valid_ibinspectable
      Daniel Duan

    • πŸ‘‰ Make nimble_operator rule correctable.
      Vojta Stavik

    • Add vertical_parameter_alignment rule that checks if parameters are vertically aligned for multi-line function declarations.
      Marcelo Fabri #1033

    • βž• Add more helpful reason strings to TrailingCommaRule.
      Matt Rubin

    • Add class_delegate_protocol rule that warns against protocol declarations that aren't marked as : class or @objc.
      Marcelo Fabri #1039

    • Add correctable redundant_optional_initialization rule that warns against initializing optional variables with nil.
      Marcelo Fabri #1052

    • redundant_nil_coalescing rule is now correctable.
      Marcelo Fabri

    • πŸ‘‰ Make number_separator rule correctable.
      Marcelo Fabri

    • empty_parentheses_with_trailing_closure rule is now correctable.
      Marcelo Fabri

    • Add correctable redundant_void_return rule that warns against explicitly adding -> Void to functions.
      Marcelo Fabri #1066

    • βž• Add an opt-in rule that enforces alphabetical sorting of imports.
      Scott Berrevoets #900

    • type_name rule forces enum values to be UpperCamelCase again when used with Swift 2.3.
      Marcelo Fabri #1090

    • πŸ‘‰ Make weak_delegate rule ignore computed properties.
      Rafael Machado #1089

    • βž• Add object_literal opt-in rule that warns against using image and color inits that can be replaced for #imageLiteral or #colorLiteral in Swift 3.
      Marcelo Fabri #1060

    • πŸ”§ Now number_separator rule can be configured with a minimum length.
      Marcelo Fabri #1109

    • Add compiler_protocol_init rule that flags usage of initializers declared in protocols used by the compiler such as ExpressibleByArrayLiteral that shouldn't be called directly. Instead, you should use a literal anywhere a concrete type conforming to the protocol is expected by the context.
      Marcelo Fabri #1096

    • βž• Add large_tuple configurable rule that validates that tuples shouldn't have too many members.
      Marcelo Fabri #1065

    • Add generic_type_name rule that validates generic constraint type names.
      Marcelo Fabri #51

    • ⚑️ Update vertical_whitespace rule to allow configuration of the number of consecutive empty lines before a violation using max_empty_lines. The default value is still 1 line.
      Aaron McTavish #769

    • Add check to ignore urls in line_length rule when ignores_urls configuration is enabled.
      Javier HernΓ‘ndez #384

    • βž• Add shorthand_operator rule that validates that shorthand operators should be used when possible.
      Marcelo Fabri #902

    • πŸ‘ Allow specifying a swiftlint_version configuration key which will log a warning if the current running version of SwiftLint is different than this value.
      JP Simard #221

    • βž• Add internal support for deprecated rule aliases.
      Marcelo Fabri #973

    • Add unused_optional_binding rule that will check for optional bindings not being used.
      Rafael Machado #1116

    πŸ› Bug Fixes
    • Ignore close parentheses on vertical_parameter_alignment rule.
      Marcelo Fabri #1042

    • πŸ›  syntactic_sugar rule now doesn't flag declarations that can't be fixed.
      Marcelo Fabri #928

    • Fix false positives on closure_parameter_position and unused_closure_parameter rules with Swift 2.3.
      Marcelo Fabri #1019

    • πŸ›  Fix crash on trailing_comma rule with Swift 2.3.
      Marcelo Fabri #921

    • πŸ›  Fix out of range exception in AttributesRule.
      JP Simard #1105

    • Fix variable_name and type_name rules on Linux.
      Marcelo Fabri

    • πŸ›  Fix linting directories with names ending with .swift.
      JP Simard

    • πŸ›  Fix running swiftlint version when building with Swift Package Manager.
      Marcelo Fabri #1045

    • Fix false positive on vertical_parameter_alignment rule when breaking line in a default parameter declaration.
      Marcelo Fabri #1129