SwiftLint v0.22.0 Release Notes

  • πŸ’₯ Breaking
    ✨ Enhancements
    • βž• Add is_disjoint rule to encourage using Set.isDisjoint(with:) over Set.intersection(_:).isEmpty.
      JP Simard

    • βž• Add xctfail_message rule to enforce XCTFail calls to include a description of the assertion.
      Ornithologist Coder #1370

    • 0️⃣ Add joined_default_parameter correctable opt-in rule to discourage explicit usage of the default separator.
      Ornithologist Coder #1093 #1757

    • Files with extensions other than .swift can now be used as arguments to --file when linting or autocorrecting.
      Marcelo Fabri #1721

    • πŸ‘ Allow ()?, Void?, ()!, and Void! as return types in redundant_void_return rule.
      Ryan Booker #1761

    • βœ… Add single_test_class opt-in rule to validate that test files only contain a single QuickSpec or XCTestCase subclass.
      Ornithologist Coder #1779

    • πŸ‘• Produce an error when a // swiftlint:disable command does not silence any violations.
      JP Simard #1102

    • Add quick_discouraged_call opt-in rule to discourage calls and object initialization inside 'describe' and 'context' block in Quick tests.
      Ornithologist Coder #1781

    • Invalidate cache when Swift version changes.
      Marcelo Fabri

    • Add pattern_matching_keywords opt-in rule to enforce moving let and var keywords outside tuples in a switch.
      Marcelo Fabri #202

    • Add explicit_enum_raw_value opt-in rule to allow refactoring the Swift API without breaking the API contract.
      Mazyod #1778

    • Add no_grouping_extension opt-in rule to disallow the use of extensions for code grouping purposes within the same file.
      Mazyod #1767

    • πŸ‘Œ Improve syntactic_sugar violation message to be type-specific.
      Marcelo Fabri #1803

    • Add multiple_closures_with_trailing_closure rule that disallows trailing closure syntax when passing more than one closure argument to a function.
      Erik Strottmann #1801

    πŸ› Bug Fixes
    • πŸ›  Fix false positive on force_unwrapping rule when declaring local variable with implicity unwrapped type.
      OtΓ‘vio Lima #1710

    • πŸ›  Fix the warning message and autocorrection of vertical_whitespace rule to display the maximum empty lines allowed if max_empty_lines is greater than 1.
      Hossam Ghareeb #1763

    • πŸ›  Fix for the wrong configuration being used when using --path and a configuration exists in a parent directory.
      Marcelo Fabri #1744

    • πŸ›  Fix false positive on unused_enumerated rule with complex variable bindings.
      Marcelo Fabri #1787

    • πŸ›  Fix incorrect violations and autocorrections on unneeded_parentheses_in_closure_argument rule that were generated in some cases (mainly when using chained method calls with closures).
      Marcelo Fabri