SwiftLint v0.47.1 Release Notes

  • ๐Ÿ’ฅ Breaking

    • None.

    Experimental

    • None.

    โœจ Enhancements

    • Add new option only_enforce_before_trivial_lines to vertical_whitespace_closing_braces rule. It restricts the rule to apply only before trivial lines (containing only closing braces, brackets and parentheses). This allows empty lines before non-trivial lines of code (e.g. if-else-statements).
      benjamin-kramer #3940

    • โž• Add type-checked analyzer rule version of ArrayInitRule named TypesafeArrayInitRule with identifier typesafe_array_init that avoids the false positives present in the lint rule.
      SimplyDanny #3749

    • โž• Add the --in-process-sourcekit command line flag to lint and analyze commands, which has the same effect as setting the IN_PROCESS_SOURCEKIT environment variable.
      Juozas Valancius

    • โž• Add a new artifactbundle release asset containing swiftlint binaries for x86 & arm64 macOS.
      Juozas Valancius #3840

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

    • โš  Don't skip autocorrect on files that have parser warnings. Only files with errors reported by the Swift parser will be skipped.
      Marcelo Fabri #3343

    • Add accessibility_label_for_image rule to warn if a SwiftUI Image does not have an accessibility label and is not hidden from accessibility.
      Ryan Cole

    • โž• Add unavailable_condition rule to prefer using if #unavailable instead of if #available with an empty body and an else condition when using Swift 5.6 or later.
      Marcelo Fabri #3897

    • โž• Add comma_inheritance rule to validate that inheritance clauses use commas instead of &.
      Marcelo Fabri #3950

    ๐Ÿ› Bug Fixes

    • Fix false positives in unused_closure_parameter when using parameters with backticks.
      JP Simard #3628

    • ๐Ÿ‘Œ Improved the syntactic_sugar rule's detection accuracy and fixed some corrections leading to invalid code.
      Paul Taykalo #3866

    • ๐Ÿ›  Fix analyzer rules with Xcode 13.3 / Swift 5.6. Note that we've measured performance regressions compared to Swift 5.5 on the order of about 2x.
      JP Simard #3920

    • 0๏ธโƒฃ Error by default on bad expiring todo date formatting.
      Christopher Hale #3636

    • ๐Ÿ‘• Lint/analyze all files listed in the command even if the --path option is used.
      coffmark