@jpsim jpsim released this Nov 14, 2018 · 60 commits to master since this release

Assets 5


  • Completely remove the --use-tabs option of the autocorrect command that
    was deprecated in 0.24.1. In its place, define an indentation key in your
    configuration files.
    JP Simard


  • Add a new swiftlint analyze command which can lint Swift files using the
    full type-checked AST. Rules of the AnalyzerRule type will be added over
    time. The compiler log path containing the clean swiftc build command
    invocation (incremental builds will fail) must be passed to analyze via
    the --compiler-log-path flag.
    e.g. --compiler-log-path /path/to/xcodebuild.log
    JP Simard

  • Add an explicit_self analyzer rule to enforce the use of explicit references
    to self. when accessing instance variables or functions.
    JP Simard

  • Add an unused_import analyzer rule to lint for unnecessary imports.
    JP Simard

  • Add an unused_private_declaration analyzer rule to lint for unused private
    JP Simard


  • Add legacy_random opt-in rule to encourage the use of .random(in:)
    instead of arc4random, arc4random_uniform, and drand48.
    Joshua Kaplan

  • Improve performance of line_length and
    multiple_closures_with_trailing_closure rules.
    Marcelo Fabri

  • Add closure_body_length opt-in rule to enforce the maximum number
    of lines a closure should have. Requires Swift 4.2.
    Ornithologist Coder

  • Add SonarQube reporter.
    Yusuke Ohashi

  • Add prohibited_interface_builder opt-in rule to validate that @IBOutlets
    and @IBActions are not used.
    Marcelo Fabri

  • Add inert_defer rule to validate that defer is not used at the end of a
    Marcelo Fabri

  • Add toggle_bool opt-in rule which suggests using someBool.toggle() over
    someBool = !someBool. Requires Swift 4.2.
    Dalton Claybrook

  • Add identical_operands opt-in rule to validate that operands are different
    expressions in comparisons.
    Marcelo Fabri

  • Add collection_alignment opt-in rule to validate that all elements in a
    collection literal are aligned vertically.
    Dalton Claybrook

  • Add static_operator opt-in rule to enforce that operators are declared as
    static functions instead of free functions.
    Marcelo Fabri

  • Specify what type of compiler protocol initializer violated the
    compiler_protocol_init rule.
    Timofey Solonin

Bug Fixes

  • Fix comma rule false positives on object literals (for example, images).
    Marcelo Fabri

  • Fix false positive on file_name rule when using nested types.
    Marcelo Fabri

  • Fix crash on multiline_function_chains rule when using some special
    characters inside the function calls.
    Marcelo Fabri

  • Change autocorrect --format to run format before autocorrect, fixing
    conflicts between default indentation and rules which modify indentation
    (i.e. closure_end_indentation).
    Ornithologist Coder

  • Fix false positive on empty_count rule when assessing binary, octal and
    hexadecimal integer literals.
    Timofey Solonin