SwiftLint v0.39.0 Release Notes

Release Date: 2020-02-11 // about 4 years ago
  • ๐Ÿ’ฅ Breaking

    • Replace all uses of Int/Int64/NSRange representing byte offsets to use newly introduced ByteCount and ByteRange values instead. This will minimize the risk of accidentally using a byte-based offset in character-based contexts.
      Paul Taykalo JP Simard

    • ๐Ÿ‘• SwiftLint now imports SwiftSyntax and requires Xcode 11.0 to build.
      Marcelo Fabri

    Experimental

    • None.

    โœจ Enhancements

    • โž• Add option to pass successfully if no files passed to SwiftLint are lintable.
      thedavidharris #2608i

    • Add deinitializer type content to type_contents_order rule instead of grouping it with initializers.
      Steven Magdy

    • ๐Ÿ‘• Inline test failure messages to make development of SwiftLint easier. Test failures in triggering and non-triggering examples will appear inline in their respective files so you can immediately see which cases are working and which are not.
      ZevEisenberg #3040

    • Introduce a new SyntaxRule that enables writing rules using SwiftSyntax.
      Marcelo Fabri

    • โž• Add tuple_pattern opt-in rule to warn against using assigning variables through a tuple pattern when the left side of the assignment contains labels.
      Marcelo Fabri #2203

    • Add return_value_from_void_function opt-in rule to warn against using return <expression> in a function that is Void.
      Marcelo Fabri

    • Add void_function_in_ternary opt-in rule to warn against using a ternary operator to call Void functions.
      Marcelo Fabri #2358

    • Add only_after_dot configuration option to empty_count rule. With the option enabled, empty_count rule will ignore variables named count. By default, this option is disabled.
      Zsolt Kovรกcs #827

    • Add prohibited_nan_comparison opt-in rule to validate using isNaN instead of comparing values to the .nan constant.
      Marcelo Fabri #2086

    • Add case preview_provider to the order list of file_types_order to fix an issue with false positives for PreviewProvider subclasses in SwiftUI.
      Cihat Gรผndรผz #2860

    ๐Ÿ› Bug Fixes

    • ๐Ÿ›  Fix false positive in attributes rule with @autoclosure parameters when using Swift 5.2.
      Mateusz Matrejek #3079

    • Fix discarded_notification_center_observer false positives when capturing observers into an array.
      Petteri Huusko

    • ๐Ÿ›  Fix crash when non-closed #if was present in file.
      PaulTaykalo

    • ๐Ÿ›  Fix false positives when line ends with carriage return + line feed.
      John Mueller #3060

    • Implicit_return description now reports current config correctly. John Buckley

    • ๐Ÿ›  Fix false positive in implicit_getter rule in extensions when using Swift 5.2.
      Marcelo Fabri #3074

    • Do not trigger optional_enum_case_matching rule on _? as the ? might be required in some situations.
      Marcelo Fabri #3057

    • ๐Ÿ›  Fix false positive in attributes rule with @escaping parameters when using Swift 5.2.
      Marcelo Fabri #3079

    • ๐Ÿ›  Fix false positive in empty_string rule when using multiline string literals.
      Marcelo Fabri #3100