SwiftLint v0.19.0 Release Notes

  • πŸ’₯ Breaking
    • βœ‚ Remove support for Swift 2.
      Marcelo Fabri #1453

    • πŸ“„ Remove missing_docs and valid_docs rules since they were already disabled.
      Marcelo Fabri #1453

    • βž• Add modificationDate(forFileAtPath:) function requirement to LintableFileManager protocol.
      Victor Pimentel

    • πŸ‘• Several breaking changes to LinterCache.
      Victor Pimentel JP Simard

    • βœ‚ Remove Configuration.hash property.
      Victor Pimentel

    • πŸ“‡ Rename ConditionalReturnsOnNewline struct to ConditionalReturnsOnNewlineRule to match rule naming conventions.
      JP Simard

    ✨ Enhancements
    • πŸ‘• Cache linter results for files unmodified since the previous linter run.
      Victor Pimentel JP Simard Marcelo Fabri #1184 #1550

    • Add opt-in configurations to generic_type_name, identifier_name and type_name rules to allow excluding non-alphanumeric characters and names that start with uppercase.
      Javier HernΓ‘ndez #541

    • βž• Adds support for excluded in custom rules to exclude files.
      Nigel Flack #1437

    • πŸ‘‰ Make trailing_comma rule autocorrectable.
      Samuel Susla Jeremy David Giesbrecht #1326

    • Added no_extension_access_modifier opt-in rule to disallow access modifiers completely, Γ  la SE-0119.
      Jose Cheyo Jimenez #1457

    • βž• Add lowercase and missing colon checks to the mark rule.
      Jason Moore

    • Improve violation reason wording in function_body_length, large_type, and type_body_length rules. Β  ultimatedbz

    • Add explicit_top_level_acl opt-in rule that validates that all top level declarations should explicitly be marked with an Access Control Level (private, fileprivate, internal, public or open).
      J. Cheyo Jimenez Marcelo Fabri #58

    • βž• Add implicit_return opt-in rule that warns against using the return keyword when it can be omitted inside closures.
      Marcelo Fabri #1194

    • Add option to unused_optional_binding rule to ignore try? in guard statements.
      Sega-Zero #1432

    • Add empty_enum_arguments correctable rule that warns against using silent associated values inside a case.
      Marcelo Fabri #1425 #1549

    • βœ‚ Remove file.zip from the Pods directory when installing SwiftLint via CocoaPods.
      Hesham Salman #1507

    • Add protocol_property_accessors_order correctable rule that validates that the order of accessors is get set when declaring variables in protocols.
      Marcelo Fabri #1504

    • πŸ‘‰ Make Region & Command structs conform to Equatable.
      JP Simard

    • πŸ‘‰ Make closure_spacing a CorrectableRule.
      J. Cheyo Jimenez

    πŸ› Bug Fixes
    • πŸ’… emoji and checkstyle reporter output report sorted by file name.
      norio-nomura #1429

    • Prevent false positive in shorthand_operator rule.
      sammy-SC #1254

    • πŸ›  Fix typo in DiscardedNotificationCenterObserverRule.
      Spencer Kaiser

    • πŸ›  Fix empty_parameters rule with Swift 3.
      Marcelo Fabri #1460

    • Prevent triggering redundant_optional_initialization rule on a lazy var since it needs initialization.
      Marcelo Fabri #1334

    • Fix ignores_case_statements key in cyclomatic_complexity description.
      Jeff Blagdon #1434

    • Fall back to reporting violations on line 1 if no line was provided for the violation's location, ensuring Xcode always displays the warning or error.
      rjhodge JP Simard #1520

    • πŸ›  Fix crash or incorrect violation location with strings including multi-byte unicode characters.
      Marcelo Fabri #1006

    • πŸ›  Fix false positive in syntactic_sugar rule when using nested types named Optional, ImplicitlyUnwrappedOptional, Array or Dictionary.
      Marcelo Fabri #1508

    • Fix false positives in prohibited_super_call & overridden_super_call rules where calls to super were done in nested scopes such as defer blocks.
      JP Simard #1301

    • πŸ›  Fix non-root configurations logging configuration warnings more than once.
      JP Simard #949

    • πŸ›  Fix some overlapping // swiftlint commands not being applied.
      JP Simard #1388