SwiftLint v0.48.0 Release Notes

  • ๐Ÿš€ This is the last release to support building with Swift 5.5.x and running on ๐ŸŽ macOS < 12.

    ๐Ÿ’ฅ Breaking

    • ๐Ÿ‘• Deprecate the --path options for lint/analyze commands. Prefer the positional paths that can be added last to both commands.
      SimplyDanny

    Experimental

    • None.

    โœจ Enhancements

    • ๐Ÿ‘Œ Support iOSApplicationExtension, macOSApplicationExtension, watchOSApplicationExtension, and tvOSApplicationExtension identifiers in the deployment_target rule. To configure the rule for these identifiers, you need to use the keys iOSApplicationExtension_deployment_target, macOSApplicationExtension_deployment_target, watchOSApplicationExtension_deployment_target, and tvOSApplicationExtension_deployment_target. Extentions default to their counterparts unless they are explicitly defined.
      tahabebek #4004

    • Rewrite operator_usage_whitespace rule using SwiftSyntax, fixing false positives and false negatives.
      Note that this rule doesn't catch violations around return arrows (->) anymore - they are already handled by return_arrow_whitespace.
      Marcelo Fabri #3965 #3668 #2728

    • ๐Ÿ‘Œ Support arrays for the included and excluded options when defining a custom rule.
      Marcelo Fabri

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

    • Support UIEdgeInsets type in prefer_zero_over_explicit_init rule.
      KokiHirokawa #3986

    ๐Ÿ› Bug Fixes

    • Ignore array types in syntactic_sugar rule if their associated Index is accessed.
      SimplyDanny #3502

    • Prevent crash for private types named _ in type_name rules. sinoru #3971

    • ๐Ÿ‘‰ Make for_where rule implementation independent of order in structure dictionary. This fixes the rule in Xcode 13.3 where some violation were no longer reported.
      SimplyDanny #3975

    • โšก๏ธ Update result builder methods in unused_declaration rule fixing some false-positives.
      SimplyDanny

    • Look for call expressions which are not wrapped into an argument when checking for nested (possibly multiline) arguments fixing some false-negatives in (at least) Xcode 13.2.
      SimplyDanny #3975

    • ๐Ÿ›  Make sure that include paths prefixed with the name of the original path are included in the analysis.
      SimplyDanny #3705

    • Do not trigger unavailable_condition rule if other #(un)available checks are involved.
      SimplyDanny #3985

    • โšก๏ธ Update nimble_operator to support the operators for beNil().
      CraigSiemens

    • Avoid false-positive in let_var_whitespace rule by allowing custom attributes on lines directly before let/var declarations.
      SimplyDanny #2980