SwiftLint v0.14.0 Release Notes

  • πŸ’₯ Breaking
    • πŸ‘• SwiftLint now requires Xcode 8.x and Swift 3.x to build. APIs have not yet been adapted to conform to the Swift 3 API Design Guidelines but will shortly.
      JP Simard Norio Nomura
    ✨ Enhancements
    • 🐧 Now builds and passes most tests on Linux using the Swift Package Manager with Swift 3. This requires libsourcekitdInProc.so to be built and located in /usr/lib, or in another location specified by the LINUX_SOURCEKIT_LIB_PATH environment variable. A preconfigured Docker image is available on Docker Hub by the ID of norionomura/sourcekit:302.
      JP Simard Norio Nomura #732

    • Add dynamic_inline rule to discourage combination of @inline(__always) and dynamic function attributes.
      Daniel Duan

    • βž• Add number_separator opt-in rule that enforces that underscores are used as thousand separators in large numbers.
      Marcelo Fabri #924

    • βž• Add file_header opt-in rule that warns when a file contains a copyright comment header, such as the one Xcode adds by default.
      Marcelo Fabri #844

    • FunctionParameterCountRule now ignores initializers.
      Denis Lebedev #544

    • βž• Add EmojiReporter: a human friendly reporter.
      MichaΕ‚ KaΕ‚uΕΌny

    • Add redundant_string_enum_value rule that warns against String enums with redundant value assignments.
      Marcelo Fabri #946

    • βž• Add attributes opt-in rule which validates if an attribute (@objc, @IBOutlet, @discardableResult, etc) is in the right position:

      • If the attribute is @IBAction or @NSManaged, it should always be on the same line as the declaration
      • If the attribute has parameters, it should always be on the line above the declaration
      • Otherwise:
        • if the attribute is applied to a variable, it should be on the same line
        • if it's applied to a type or function, it should be on the line above
        • if it's applied to an import (the only option is @testable import), it should be on the same line. You can also configure what attributes should be always on a new line or on the same line as the declaration with the always_on_same_line and always_on_line_above keys.

    Marcelo Fabri #846

    • Add empty_parentheses_with_trailing_closure rule that checks for empty parentheses after method call when using trailing closures.
      Marcelo Fabri #885

    • Add closure_parameter_position rule that validates that closure parameters are in the same line as the opening brace.
      Marcelo Fabri #931

    • type_name rule now validates typealias and associatedtype too.
      Marcelo Fabri #49 #956

    • βž• Add ProhibitedSuperRule opt-in rule that warns about methods calling to super that should not, for example UIViewController.loadView().
      Aaron McTavish #970

    • βž• Add correctable void_return rule to validate usage of -> Void over -> ().
      Marcelo Fabri JP Simard #964

    • βž• Add correctable empty_parameters rule to validate usage of () -> over Void ->.
      Marcelo Fabri #573

    • Add operator_usage_whitespace opt-in rule to validate that operators are surrounded by a single whitespace when they are being used.
      Marcelo Fabri #626

    • Add unused_closure_parameter correctable rule that validates if all closure parameters are being used. If a parameter is unused, it should be replaced by _.
      Marcelo Fabri JP Simard #982

    • βž• Add unused_enumerated rule that warns against unused indexes when using .enumerated() on a for loop, e.g. for (_, foo) in bar.enumerated().
      Marcelo Fabri #619

    πŸ› Bug Fixes
    • πŸ›  Fix weak_delegate rule reporting a violation for variables containing but not ending in delegate.
      Phil Webster

    • πŸ›  Fix weak_delegate rule reporting a violation for variables in protocol declarations.
      Marcelo Fabri #934

    • πŸ›  Fix trailing_comma rule reporting a violation for commas in comments.
      Marcelo Fabri #940

    • πŸ›  Fix XML reporters not escaping characters.
      Fabian Ehrentraud #968

    • πŸ›  Fix specifying multiple rule identifiers in comment commands.
      JP Simard #976

    • πŸ›  Fix invalid CSS in HTML reporter template.
      Aaron McTavish #981

    • πŸ›  Fix crash when correcting statement_position rule when there are multi-byte characters in the file.
      Marcelo Fabri