0.26.0: Maytagged Pointers

@jpsim jpsim released this Jun 22, 2018 · 64 commits to master since this release

Breaking

Enhancements

  • Add optional filename verification to the file_header rule.
    All occurrences in the pattern of the SWIFTLINT_CURRENT_FILENAME
    placeholder are replaced by the name of the validated file.
    Anders Hasselqvist
    #1079

  • Updates the untyped_error_in_catch rule to support autocorrection.
    Daniel Metzing

  • Add no_fallthrough_only rule to check that case statements do not
    contain only a fallthrough.
    Austin Belknap

  • Add indented_cases support to switch_case_alignment rule.
    Shai Mishali
    #2119

  • Add opt-in modifier_order to enforce the order of declaration modifiers.
    Requires Swift 4.1 or later.
    Jose Cheyo Jimenez
    Daniel Metzing
    #1472
    #1585

  • Validate implicit subscript getter in implicit_getter rule when using
    Swift 4.1 or later.
    Marcelo Fabri
    #898

  • Add unavailable_function opt-in rule to validate that functions that are
    currently unimplemented (using a placeholder fatalError) are marked with
    @available(*, unavailable).
    Marcelo Fabri
    #2127

  • Updates the closure_end_indentation rule to support autocorrection.
    Eric Horacek

  • Updates the literal_expression_end_indentation rule to support
    autocorrection.
    Eric Horacek

  • Add a new multiline_function_chains rule to validate that chained function
    calls start either on the same line or one per line.
    Eric Horacek
    #2214

  • Improves the mark rule's autocorrection.
    Eric Horacek

  • Add redundant_set_access_control rule to warn against using redundant
    setter ACLs on variable declarations.
    Marcelo Fabri
    #1869

  • Add a new ignores_interpolated_strings config parameter to the line_length
    rule to ignore lines that include interpolated strings from this rule.
    Michael Gray
    #2100

  • Add a new ignores_default_parameters config parameter to the
    function_parameter_count rule to ignore default parameter when calculating
    parameter count. True by default.
    Varun P M
    #2171

  • Add empty_xctest_method opt-in rule which warns against empty
    XCTest methods.
    Ornithologist Coder
    #2190

  • Add function_default_parameter_at_end opt-in rule to validate that
    parameters with defaults are located toward the end of the parameter list in a
    function declaration.
    Marcelo Fabri
    #2176

  • Add file_name opt-in rule validating that file names contain the name of a
    type or extension declared in the file (if any).
    JP Simard
    #1420

  • Add convenience_type opt-in rule to validate that types hosting only static
    members should be enums to avoid instantiation.
    Marcelo Fabri
    #1871

Bug Fixes

  • Update LowerACLThanParent rule to not lint extensions.
    Keith Smiley
    #2164

  • Fix operator usage spacing nested generics false positive.
    Eric Horacek
    #1341
    #1897

  • Fix autocorrection for several rules
    (empty_parentheses_with_trailing_closure, explicit_init,
    joined_default_parameter, redundant_optional_initialization and
    unused_closure_parameter) when used with preprocessor macros.
    John Szumski
    Marcelo Fabri

  • Fix unneeded_parentheses_in_closure_argument false negatives when multiple
    violations are nested.
    Marcelo Fabri
    #2188

  • Fix false negatives in implicit_return rule when using closures as
    function arguments.
    Marcelo Fabri
    #2187

  • Fix false positives in attributes rule when @testable is used.
    Marcelo Fabri
    #2211

  • Fix false positives in prohibited_super_call rule.
    Marcelo Fabri
    #2212

  • Fix a false positive in unused_closure_parameter rule when a parameter
    is used in a string interpolation.
    Marcelo Fabri
    #2062

  • Fixes a case where the closure_end_indentation rule wouldn't lint the end
    indentation of non-trailing closure parameters.
    Eric Horacek
    #2121

0.25.1: Lid Locked

@jpsim jpsim released this Apr 8, 2018 · 258 commits to master since this release

This is the last release to support building with Swift 3.2 and Swift 3.3.
The next release will require Swift 4.0 or higher to build.

Breaking

  • None.

Enhancements

  • Add LowerACLThanParent rule.
    Keith Smiley
    #2136

  • Add UIOffsetMake to legacy_constructor rule.
    Nealon Young
    #2126

  • Add a new excluded config parameter to the explicit_type_interface rule
    to exempt certain types of variables from the rule.
    Rounak Jain
    #2028

  • Add empty_string opt-in rule to validate against comparing strings to ""
    instead of using .isEmpty.
    Davide Sibilio

  • Add untyped_error_in_catch opt-in rule to warn against declaring errors
    without an explicit type in catch statements instead of using the implicit
    error variable.
    Daniel Metzing
    #2045

  • Add all keyword for use in disable / enable statement:
    // swiftlint:disable all.
    It allows disabling SwiftLint entirely, in-code, for a particular section.
    fredpi
    #2071

  • Adds --force-exclude option to lint and autocorrect commands, which will
    force SwiftLint to exclude files specified in the config excluded even if
    they are explicitly specified with --path.
    Ash Furrow
    #2051

  • Adds discouraged_optional_collection opt-in rule to encourage the use of
    empty collections instead of optional collections.
    Ornithologist Coder
    #1885

  • Add 4.1.0, 4.1.1 and 4.2.0 to Swift version detection.
    Norio Nomura
    #2143

  • Support building with Swift 4.1.
    Norio Nomura
    #2038

Bug Fixes

  • Fixes an issue with the yoda_condition rule where the severity would always
    display as a warning, and the reason would display as the severity type.
    Twig

  • Fix TODOs lint message to state that TODOs should be resolved instead of
    avoided.
    Adonis Peralta
    #150

  • Fix some cases where colon rule wouldn't autocorrect dictionary literals.
    Marcelo Fabri
    #2050

  • Fix linux crash on sources with surrogate pair emojis as variable names.
    Cyril Lashkevich

  • Make legacy_constructor rule more reliable, especially for autocorrecting.
    Marcelo Fabri
    #2098

  • Fix colon rule autocorrect when preprocessor macros are present.
    Marcelo Fabri
    #2099

  • Fix crash when saving cache if there're entries referring to the same path
    but with different capitalization.
    Marcelo Fabri
    #2032

  • Fix several rules (empty_enum_arguments, explicit_init
    empty_parentheses_with_trailing_closure, joined_default_parameter,
    redundant_optional_initialization, redundant_void_return and
    unused_closure_parameter) rules autocorrection inside functions or other
    declarations.
    Marcelo Fabri

  • Fix redundant_void_return rule autocorrect when preprocessor macros are
    present.
    John Szumski
    #2115

  • Fix issue where the autocorrect done message used the plural form of "files"
    even if only 1 file changed.
    John Szumski

  • Fix false positives in attributes rule when using Swift 4.1.
    Marcelo Fabri
    #2125
    #2141

0.25.0: Cleaning the Lint Filter

@marcelofabri marcelofabri released this Feb 12, 2018 · 394 commits to master since this release

Breaking

  • None.

Enhancements

Bug Fixes

  • Fix some cases where colon rule wouldn't be autocorrected.
    Manabu Nakazawa

  • Fix false positives in explicit_acl rule when declaring functions and
    properties in protocols or implementing deinit.
    Marcelo Fabri
    #2014

  • Fix false negatives in unneeded_parentheses_in_closure_argument rule
    when using _ as one of the closure arguments.
    Marcelo Fabri
    #2017

  • Fix several rules that use attributes when linting with a Swift 4.1 toolchain.
    Marcelo Fabri
    #2019

  • Don't trigger violations in let_var_whitespace rule when using local
    variables when linting with a Swift 4.1 toolchain.
    Marcelo Fabri
    #2021

  • Improve type_name rule violations to be positioned on the type name.
    Marcelo Fabri
    #2021

  • Use SourceKit to validate associatedtype and typealias in type_name rule
    when linting with Swift 4.1.
    Marcelo Fabri
    #2021

  • Fix some cases where violations would still be triggered when using the
     ignores_function_declarations configuration of line_length rule.
     Manabu Nakazawa

  • Fix false positive in empty_enum_arguments rule when using closures.
    Marcelo Fabri
    #2041

  • Fix false positives in force_unwrapping rule when declaring functions that
    return implicitly unwrapped collections (for example [Int]! or
    [AnyHashable: Any]!).
    Marcelo Fabri
    #2042

  • Fix directories with a .swift suffix being treated as files.
    Jamie Edge
    #1948

0.24.2: Dented Tumbler

@jpsim jpsim released this Jan 10, 2018 · 444 commits to master since this release

Breaking

  • None.

Enhancements

  • None.

Bug Fixes

  • No longer log if the indentation key isn't set in the configuration file.
    JP Simard
    #1998

0.24.1: Dented Tumbler

Breaking
  • None.
Enhancements
  • Invalidate cache when Swift patch version changes.
    Norio Nomura

  • Add private_action opt-in rule which warns against public
    @IBAction methods.
    Ornithologist Coder
    #1931

  • Add yoda_condition opt-in rule which warns when Yoda conditions are used.
    That is, when the constant portion of the expression is on the left side of a
    conditional statement.
    Daniel Metzing
    #1924

  • Indentation can now be specified via a configuration file.
    Noah McCann
    RubenSandwich
    #319

  • Add required_enum_case opt-in rule which allows enums that
    conform to protocols to require one or more cases. Useful for
    result enums.
    Donald Ritter

  • Add discouraged_object_literal opt-in rule which encourages initializers
    over object literals.
    Ornithologist Coder
    #1987

  • Adds prefixed_toplevel_constant opt-in rule which encourages top-level
    constants to be prefixed by k.
    Ornithologist Coder
    #1907

  • Added explicit_acl opt-in rule to enforce explicit access control levels.
    Josep Rodriguez
    #1822

Bug Fixes
  • Fix false positives in control_statement rule when methods with keyword
    names are used.
    Marcelo Fabri
    #1946

  • Fix false positives in for_where rule when pattern matching (if case)
    is used.
    Marcelo Fabri
    #1968

  • Fix false positives in unused_closure_parameter rule when closure is wrapped
    in parentheses.
    JP Simard
    #1979

0.24.0: Timed Dry

Breaking
Enhancements
  • Add sorted_first_last opt-in rule to encourage using min() or max()
    over sorted().first or sorted().last.
    Tom Quist
    #1932

  • Add quick_discouraged_focused_test opt-in rule which warns against
    focused tests in Quick tests.
    Ornithologist Coder
    #1905

  • Add override_in_extension opt-in rule that warns against overriding
    declarations in an extension.
    Marcelo Fabri
    #1884

  • Add [f,x]{describe, context, itBehavesLike} to quick_discouraged_call
    rule.
    Ornithologist Coder
    #1903

  • Add quick_discouraged_pending_test opt-in rule which warns against
    pending tests in Quick tests.
    Ornithologist Coder
    #1909

  • Speed up equality tests for [Rule] and Configuration values.
    JP Simard

  • Make Configuration conform to Hashable.
    JP Simard

  • Speed up reading cached results by about 200%.
    JP Simard

  • Add catch to the statements checked by the control_statement rule.
    JP Simard

  • Make sorted_imports correctable.
    Samuel Susla
    JP Simard
    #1822

  • Make sorted_imports only validate within "groups" of imports on directly
    adjacent lines.
    Samuel Susla
    JP Simard
    #1822

Bug Fixes
  • Extend first_where and contains_over_first_not_nil rules to also detect
    cases where calls to filter and first are parenthesized.
    Tom Quist

  • Correct equality tests for Configuration values. They previously didn't
    account for warningThreshold or cachePath.
    JP Simard

  • Fix false positive in multiline_parameters rule when parameter is a closure
    with default value.
    Ornithologist Coder
    #1912

  • Fix caching on Linux.
    JP Simard

  • Fix crashes due to races.
    JP Simard

  • Fix String.characters deprecation warnings when compiling with Swift
    4.0.2.
    JP Simard

0.24.1: Dented Tumbler

@jpsim jpsim released this Jan 8, 2018 · 448 commits to master since this release

Breaking
  • None.
Enhancements
  • Invalidate cache when Swift patch version changes.
    Norio Nomura

  • Add private_action opt-in rule which warns against public
    @IBAction methods.
    Ornithologist Coder
    #1931

  • Add yoda_condition opt-in rule which warns when Yoda conditions are used.
    That is, when the constant portion of the expression is on the left side of a
    conditional statement.
    Daniel Metzing
    #1924

  • Indentation can now be specified via a configuration file.
    Noah McCann
    RubenSandwich
    #319

  • Add required_enum_case opt-in rule which allows enums that
    conform to protocols to require one or more cases. Useful for
    result enums.
    Donald Ritter

  • Add discouraged_object_literal opt-in rule which encourages initializers
    over object literals.
    Ornithologist Coder
    #1987

  • Adds prefixed_toplevel_constant opt-in rule which encourages top-level
    constants to be prefixed by k.
    Ornithologist Coder
    #1907

  • Added explicit_acl opt-in rule to enforce explicit access control levels.
    Josep Rodriguez
    #1822

Bug Fixes
  • Fix false positives in control_statement rule when methods with keyword
    names are used.
    Marcelo Fabri
    #1946

  • Fix false positives in for_where rule when pattern matching (if case)
    is used.
    Marcelo Fabri
    #1968

  • Fix false positives in unused_closure_parameter rule when closure is wrapped
    in parentheses.
    JP Simard
    #1979

0.24.0: Timed Dry

@jpsim jpsim released this Nov 10, 2017 · 533 commits to master since this release

Breaking
Enhancements
  • Add sorted_first_last opt-in rule to encourage using min() or max()
    over sorted().first or sorted().last.
    Tom Quist
    #1932

  • Add quick_discouraged_focused_test opt-in rule which warns against
    focused tests in Quick tests.
    Ornithologist Coder
    #1905

  • Add override_in_extension opt-in rule that warns against overriding
    declarations in an extension.
    Marcelo Fabri
    #1884

  • Add [f,x]{describe, context, itBehavesLike} to quick_discouraged_call
    rule.
    Ornithologist Coder
    #1903

  • Add quick_discouraged_pending_test opt-in rule which warns against
    pending tests in Quick tests.
    Ornithologist Coder
    #1909

  • Speed up equality tests for [Rule] and Configuration values.
    JP Simard

  • Make Configuration conform to Hashable.
    JP Simard

  • Speed up reading cached results by about 200%.
    JP Simard

  • Add catch to the statements checked by the control_statement rule.
    JP Simard

  • Make sorted_imports correctable.
    Samuel Susla
    JP Simard
    #1822

  • Make sorted_imports only validate within "groups" of imports on directly
    adjacent lines.
    Samuel Susla
    JP Simard
    #1822

Bug Fixes
  • Extend first_where and contains_over_first_not_nil rules to also detect
    cases where calls to filter and first are parenthesized.
    Tom Quist

  • Correct equality tests for Configuration values. They previously didn't
    account for warningThreshold or cachePath.
    JP Simard

  • Fix false positive in multiline_parameters rule when parameter is a closure
    with default value.
    Ornithologist Coder
    #1912

  • Fix caching on Linux.
    JP Simard

  • Fix crashes due to races.
    JP Simard

  • Fix String.characters deprecation warnings when compiling with Swift
    4.0.2.
    JP Simard

0.23.1: Rewash: Forgotten Load Edition

@jpsim jpsim released this Oct 10, 2017 · 626 commits to master since this release

Breaking
  • None.
Enhancements
  • None.
Bug Fixes
  • Fix false positive in array_init rule when using a map that
    doesn't take a closure.
    Marcelo Fabri
    #1878

  • superfluous_disable_command rule can now be disabled as expected when
    using // swiftlint:disable superfluous_disable_command.
    Marcelo Fabri
    #1890

0.23.0: Permanent Press Cycle

@marcelofabri marcelofabri released this Oct 4, 2017 · 626 commits to master since this release

Breaking
  • None.
Enhancements
  • Fix csv reporter to output records with new lines.
    atetlaw

  • Add contains_over_first_not_nil rule to encourage using contains over
    first(where:) != nil.
    Samuel Susla
    #1514

  • Add fallthrough rule that flags usage of fallthrough.
    Marcelo Fabri
    #1834

  • Improve colon rule to catch violations in dictionary types
    (e.g. [String: Int]), when using Any and on function calls.
    Marcelo Fabri
    #1074
    #1389

  • Add switch_case_alignment rule to validate that case and default
    statements are vertically aligned with their enclosing switch statement.
    Austin Lu

  • Add array_init opt-in rule to validate that Array(foo) should be preferred
    over foo.map({ $0 }).
    Marcelo Fabri
    #1271

  • Truncate long configuration console descriptions to fit in the console window
    when running swiftlint rules.
    JP Simard
    #1002

  • Add multiline_arguments opt-in rule that warns to either keep
    all the arguments of a function call on the same line,
    or one per line.
    Marcel Jackwerth

  • Add unneeded_break_in_switch rule to validate that no extra breaks are
    added in switch statements.
    Marcelo Fabri
    #1870

  • Add literal_expression_end_indentation opt-in rule to validate that
    array and dictionary literals ends have the same indentation as the line
    that started them.
    Marcelo Fabri
    #1435

Bug Fixes
  • Improve how opening_brace rule reports violations locations.
    Marcelo Fabri
    #1811

  • Fix false negatives in unneeded_parentheses_in_closure_argument rule
    when using capture lists.
    Marcelo Fabri
    #1817

  • Fix handling of attributes (lazy, objc, etc.) for the let_var_whitespace
    rule.
    David Catmull
    #1770
    #1812

  • Fix false positives in for_where rule when using if var inside for.
    Marcelo Fabri
    #1838

  • Fix false positive in class_delegate_protocol rule when using Swift 4.0.1.
    Marcelo Fabri
    #1856

  • Print multi-line configuration values in a single line when running
    swiftlint rules to avoid breaking the table format.
    JP Simard
    #1002

  • Ignore SwiftLint commands (swiftlint:(disable|enable)) in file_header
    rule, making it work better with superfluous_disable_command rule.
    Marcelo Fabri
    #1810

  • Fix false negatives in generic_type_name, identifier_name and type_name
    rules when using allowed_symbols.
    Marcelo Fabri

0.22.0: Wrinkle-free

@marcelofabri marcelofabri released this Aug 30, 2017 · 736 commits to master since this release

Breaking
Enhancements
  • Add is_disjoint rule to encourage using Set.isDisjoint(with:) over
    Set.intersection(_:).isEmpty.
    JP Simard

  • Add xctfail_message rule to enforce XCTFail
    calls to include a description of the assertion.
    Ornithologist Coder
    #1370

  • Add joined_default_parameter correctable opt-in rule to discourage
    explicit usage of the default separator.
    Ornithologist Coder
    #1093
    #1757

  • Files with extensions other than .swift can now be used as arguments
    to --file when linting or autocorrecting.
    Marcelo Fabri
    #1721

  • Allow ()?, Void?, ()!, and Void! as return types in
    redundant_void_return rule.
    Ryan Booker
    #1761

  • Add single_test_class opt-in rule to validate that test files
    only contain a single QuickSpec or XCTestCase subclass.
    Ornithologist Coder
    #1779

  • Produce an error when a // swiftlint:disable command does not silence
    any violations.
    JP Simard
    #1102

  • Add quick_discouraged_call opt-in rule to discourage calls and object
    initialization inside 'describe' and 'context' block in Quick tests.
    Ornithologist Coder
    #1781

  • Invalidate cache when Swift version changes.
    Marcelo Fabri

  • Add pattern_matching_keywords opt-in rule to enforce moving let and var
    keywords outside tuples in a switch.
    Marcelo Fabri
    #202

  • Add explicit_enum_raw_value opt-in rule to allow refactoring the
    Swift API without breaking the API contract.
    Mazyod
    #1778

  • Add no_grouping_extension opt-in rule to disallow the use of extensions
    for code grouping purposes within the same file.
    Mazyod
    #1767

  • Improve syntactic_sugar violation message to be type-specific.
    Marcelo Fabri
    #1803

  • Add multiple_closures_with_trailing_closure rule that disallows trailing
    closure syntax when passing more than one closure argument to a function.
    Erik Strottmann
    #1801

Bug Fixes
  • Fix false positive on force_unwrapping rule when declaring
    local variable with implicity unwrapped type.
    Otávio Lima
    #1710

  • Fix the warning message and autocorrection of vertical_whitespace rule to
    display the maximum empty lines allowed if max_empty_lines is greater
    than 1.
    Hossam Ghareeb
    #1763

  • Fix for the wrong configuration being used when using --path and a
    configuration exists in a parent directory.
    Marcelo Fabri
    #1744

  • Fix false positive on unused_enumerated rule with complex variable
    bindings.
    Marcelo Fabri
    #1787

  • Fix incorrect violations and autocorrections on
    unneeded_parentheses_in_closure_argument rule that were generated in some
    cases (mainly when using chained method calls with closures).
    Marcelo Fabri

0.21.0: Vintage Washboard

@marcelofabri marcelofabri released this Aug 1, 2017 · 886 commits to master since this release

Breaking
  • Xcode 8.3 or later and Swift 3.1 or later are required to build.
    Norio Nomura
Enhancements
  • Rules are now categorized as lint, idiomatic, style, metrics
    or performance. Currently this is just used for documentation purposes
    when you run swiftlint rules or swiftlint generate-docs.
    Marcelo Fabri

  • Add rules documentation generation.
    Marcelo Fabri
    #1078

  • Add private_over_fileprivate correctable rule to check for top-level usages
    of fileprivate and recommend private instead. This is in line with
    SE-0169's goal "for fileprivate to be used rarely". There is a also a new
    strict_fileprivate opt-in rule that will mark every fileprivate
    as a violation (especially useful with Swift 4).
    Jose Cheyo Jimenez
    Marcelo Fabri
    #1469
    #1058

  • Add let_var_whitespace opt-in rule to enforce that let/var declarations
    should be separated from other statements by a single blank line.
    Uncommon
    #1461

  • Improve performance when linting and correcting on Linux,
    matching macOS behavior.
    JP Simard
    #1577

  • Don't trigger implicit_getter violations when attributes (such as mutating
    or @inline) are present.
    Marcelo Fabri
    #1309
    #1589

  • Add --use-tabs option to AutoCorrectOptions, enabling formatting using
    tabs over spaces.
    Cody Winton
    #1327

  • Improve autocorrect performance by running it in parallel.
    Marcelo Fabri
    #1578

  • Support building with Xcode 9 beta 3 in Swift 3.2 mode.
    JP Simard

  • Add support for optional error severity level configuration.
    Jamie Edge
    Marcelo Fabri
    #1647

  • Add unneeded_parentheses_in_closure_argument opt-in correctable rule that
    warns against using parentheses around argument declarations in closures.
    Marcelo Fabri
    #1483

  • Add --disabled flag to swiftlint rules to print only rules that are
    not enabled in the configuration.
    Marcelo Fabri

  • Add ignore_comment_only_lines boolean configuration option
    to file_length rule. With the option enabled, file_length will
    ignore lines which have only comments.
    Samuel Susla
    #1165

  • Improve file_header rule description.
    Marcelo Fabri
    #1492

  • Add trailing_closure opt-in rule that validates that trailing
    closure syntax should be used whenever possible.
    Marcelo Fabri
    #54

  • Shebang (#!) in the beginning of a file is now ignored by all rules.
    Marcelo Fabri
    #1294

  • Add block_based_kvo rule that enforces the usage of the new block based
    KVO API added when linting with Swift 3.2 or later.
    Marcelo Fabri
    #1714

  • Make file_header rule ignore doc comments.
    Marcelo Fabri
    #1719

  • Allow using environment variables in a configuration file in the form of
    ${SOME_VARIABLE}. The variables will be expanded when the configuration
    is first loaded.
    Marcelo Fabri
    #1512

  • Treat yes, no, on and off as strings (and not booleans) when loading
    configuration files.
    Marcelo Fabri
    #1424

  • Add discouraged_direct_init rule that discourages direct
    initialization of certain types.
    Ornithologist Coder
    #1306

Bug Fixes
  • Fix false positive on redundant_discardable_let rule when using
    while statements.
    Marcelo Fabri
    #1669

  • Fix all custom rules not being applied when any rule is configured
    incorrectly.
    Jamie Edge
    #1586

  • Fix crash when using --config with a relative path and
    --path with a file.
    Marcelo Fabri
    #1694

  • Fix mark rule corrections generating invalid code in some cases.
    Marcelo Fabri
    #1029

  • Fix false positive in empty_enum_arguments rule when using wildcards and
    where clauses.
    Marcelo Fabri
    #1722

  • Fix false positive in large_tuple rule when using throwing closure.
    Liquidsoul

  • Make vertical_parameter_alignment more robust, fixing false positives and
    detecting previously missed violations.
    JP Simard
    #1488