Skip to content

Releases: realm/SwiftLint

0.30.1: Localized Stain Remover

23 Jan 19:13
Compare
Choose a tag to compare

Breaking

  • None.

Experimental

  • Silence CodingKeys violations in unused_private_declaration since these
    should always be intentional violations.
    Kim de Vos
    #2573

Enhancements

  • Add nslocalizedstring_key opt-in rule to validate that keys used in
    NSLocalizedString calls are static strings, so genstrings will be
    able to find them.
    Marcelo Fabri

Bug Fixes

  • Fix false positives on trailing_closure rule when using anonymous closure
    calls.
    Marcelo Fabri
    #2159

  • Fix false positives on array_init rule when using prefix operators.
    Marcelo Fabri
    #1877

  • Exclude files defined in the excluded value of SwiftLint's configuration
    when --use-script-input-files and --force-exclude are specified.
    Luis Valdés
    #591

0.30.0: A New Washer and Dryer Set

18 Jan 07:36
Compare
Choose a tag to compare

Breaking

  • None.

Experimental

  • None.

Enhancements

  • Add duplicate_imports rule to prevent importing the same module twice.
    Samuel Susla
    #1881

  • Add unused_setter_value rule to validate that setter arguments are
    used in properties.
    Marcelo Fabri
    #1136

  • Add only_single_muted_parameter configuration on trailing_closure rule
    to only enforce using trailing closure on functions that take one single
    muted parameter.
    Marcelo Fabri

Bug Fixes

  • Fix false positives on identical_operands rule when the right side of the
    operand has a chained optional.
    JP Simard
    #2564

0.29.4: In-Unit Operands

16 Jan 22:30
0328f83
Compare
Choose a tag to compare

Breaking

  • None.

Experimental

  • Fix unused_import correction deleting unrelated ranges when there are
    multiple violations in a single file.
    JP Simard
    #2561

Enhancements

  • Add strong_iboutlet opt-in rule to enforce that @IBOutlets are not
    declared as weak.
    Marcelo Fabri
    #2433

Bug Fixes

  • Fix inaccessible custom rules in nested configurations.
    Timofey Solonin
    #1815
    #2441

  • Improve superfluous_disable_command to warn against disabling non-existent
    rules.
    Kim de Vos
    #2348

  • Fix false positives on identical_operands rule when the right side of the
    operand does not terminate.
    Xavier Lowmiller
    #2467

0.29.3: Entangled Agitator

08 Jan 00:31
bd0f78a
Compare
Choose a tag to compare

Breaking

  • None.

Experimental

  • Skip @IBInspectable and deinit declarations in
    unused_private_declaration.
    JP Simard

Enhancements

  • Allow configuring discouraged_object_literal rule to only discourage one
    kind of object literal.
    Marcelo Fabri
    #2439

  • Adds xct_specific_matcher opt-in rule to enforce specific matchers
    over XCTAssertEqual and XCTAssertNotEqual.
    Ornithologist Coder
    #1874

  • Add last_where opt-in rule that warns against using
    .filter { /* ... */ }.last in collections, as
    .last(where: { /* ... */ }) is more efficient.
    Marcelo Fabri

  • Add unused_control_flow_label rule to validate that control flow labels are
    used.
    Marcelo Fabri
    #2227

Bug Fixes

  • Fix false positives on first_where rule when calling filter without a
    closure parameter (for example on a Realm collection).
    Marcelo Fabri

  • Fix false positives on sorted_first_last rule when calling sorted with
    a different argument than by: (e.g. on a Realm collection).
    Marcelo Fabri
    #2533

  • Fix false positives on redundant_objc_attribute rule when using nested
    types.
    Marcelo Fabri
    #2539

  • Fix false positives on vertical_whitespace_between_cases rule when a blank
    line is present but it contains trailing whitespace.
    Ben Staveley-Taylor
    #2538

0.29.2: Washateria

24 Dec 04:33
a21a8b3
Compare
Choose a tag to compare

Breaking

  • None.

Experimental

  • None.

Enhancements

  • Add new opt-in rule vertical_whitespace_opening_braces to warn against empty
    lines after opening braces.
    Cihat Gündüz
    #1518

  • Add new opt-in rule vertical_whitespace_closing_braces to warn against empty
    lines before closing braces.
    Cihat Gündüz
    #1518

  • Improve performance for unused_private_declaration and unused_import rules
    for large files.
    Niil Öhlin

  • Add new legacy_hashing rule to encourage the use of Swift 4.2's new hashing
    interface.
    Kim de Vos
    #2108

  • Improve private_unit_test rule to allow private classes with @objc
    attribute.
    Kim de Vos
    #2282

  • Support glob patterns without the star.
    Maksym Grebenets

  • Make modifier_order rule autocorrectable.
    Timofey Solonin
    #2353

Bug Fixes

  • Fix false positives in redundant_objc_attribute for private declarations
    under @objcMembers.
    Daniel Metzing
    #2499

  • Fix an error when pulling SwiftLint as a dependency using Carthage.
    JP Simard

  • Non-string values specified in swiftlint_version now fail the lint if
    it doesn't match the version.
    JP Simard
    #2518

0.29.1: There’s Always More Laundry

29 Nov 22:29
c3d23ea
Compare
Choose a tag to compare

Breaking

  • None.

Experimental

  • None.

Enhancements

  • Add redundant_objc_attribute to warn against already implied @objc
    attribute.
    Daniel Metzing
    #2193

  • Add vertical_whitespace_between_cases opt-in rule to enforce a single
    empty line between switch cases.
    Cihat Gündüz
    #1517

  • Add multiline_arguments_brackets opt-in rule to warn against multiline
    function call arguments with surrounding brackets without newline.
    Cihat Gündüz
    #2306

  • Add multiline_literal_brackets opt-in rule to warn against multiline
    literal arrays & dictionaries with surrounding brackets without newline.
    Cihat Gündüz
    #2306

  • Add multiline_parameters_brackets opt-in rule to warn against multiline
    function definition parameters with surrounding brackets without newline.
    Cihat Gündüz
    #2306

  • Ignore unspecified modifiers in modifier_order.
    Timofey Solonin
    #2435

  • The lint command now exits with a code of 2 when not using pinned
    version defined as swiftlint_version in the configuration file.
    Kim de Vos
    #2074

Bug Fixes

  • Fix false positive in nimble_operator rule.
    Marcelo Fabri
    #2489

  • Fix false positives on explicit_type_interface rule when
    configured with option allowRedundancy set to true.
    Cihat Gündüz
    #2425

  • Only mark custom rules as 'enabled in your config' in the output of the
    rules command when there are one or more configured custom rules.
    jhildensperger

  • Fix wrong correction when removing testable imports with the unused_import
    rule.
    JP Simard

  • Fix false positive with the unused_import rule when importing Foundation
    when there are attributes in that file requiring Foundation.
    JP Simard

0.29.0: A Laundry List of Changes

27 Nov 21:32
8fc75e3
Compare
Choose a tag to compare

Breaking

  • SwiftLint now requires Swift 4.2 or higher to build.
    JP Simard

Experimental

  • None.

Enhancements

  • Improve the performance of saving or reading cached lint results on platforms
    with CommonCrypto.
    JP Simard

  • Add markdown reporter which outputs markdown-formatted tables, ideal for
    rendering in GitLab or GitHub.
    Dani Vela

  • Add testSimulateHomebrewTest() to IntegrationTests that simulates test in
    homebrew-core/Formula/swiftlint.rb within sandbox.
    Norio Nomura

Bug Fixes

  • Fix compiler warnings when building with Swift 4.2 introduced in the last
    release.
    JP Simard

  • Fix false positive in explicit_init rule.
    Dominic Freeston

  • Fix toggle_bool false positive violation when comparing object parameter to
    an equally named variable.
    Timofey Solonin
    #2471

  • Fix false positive on file_name rule with specific patterns.
    Cihat Gündüz
    #2417

  • Fix crash in no_fallthrough_only and potentially other rules when linting
    files with unicode characters in certain locations.
    JP Simard
    #2276

  • Fix violations with no character/column location not being reported in
    xcpretty. Now violations with no column location default to a column value
    of 1 indicating the start of the line.
    JP Simard
    #2267

0.28.2: EnviroBoost Plus

24 Nov 19:31
4cee937
Compare
Choose a tag to compare

Breaking

  • None.

Experimental

  • None.

Enhancements

  • Add SWIFTLINT_DISABLE_SOURCEKIT environment variable to allow running
    SwiftLint without connecting to SourceKit. This will run a subset of rules
    that don't require SourceKit, which is useful when running in a sandboxed
    setting such as in Homebrew's CI.
    Norio Nomura

Bug Fixes

  • None.

0.28.1: EnviroBoost

18 Nov 23:42
4955c17
Compare
Choose a tag to compare

This is the last release to support building with Swift 4.0 and Swift 4.1.

Breaking

  • None.

Experimental

  • None.

Enhancements

  • None.

Bug Fixes

  • Improve the performance of collecting which files to lint by up to 3.5x.
    JP Simard

  • Improve the performance of looking up cached lint results by up to 10x for
    complex configurations.
    JP Simard

0.28.0: EcoBoost

14 Nov 06:48
94dd8b4
Compare
Choose a tag to compare

Breaking

  • 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

Experimental

  • 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
    #321

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

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

Enhancements

  • 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
    #52

  • Add SonarQube reporter.
    Yusuke Ohashi
    #2350

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

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

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

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

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

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

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

Bug Fixes

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

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

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

  • 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
    #2374

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