All Versions
99
Latest Version
Avg Release Cycle
29 days
Latest Release
-

Changelog History
Page 7

  • v0.20.1 Changes

    πŸ’₯ Breaking
    • None.
    ✨ Enhancements
    • None.
    πŸ› Bug Fixes
    • πŸ›  Fix typo in FatalErrorMessageRule.
      Alexander Lash

    • Don't trigger an extension_access_modifier violation when all extension members are open, as open extension is not supported by Swift.
      Marcelo Fabri #1629

    • Don't trigger a vertical_parameter_alignment_on_call violation when trailing closures are used.
      Marcelo Fabri #1635

    • Make vertical_parameter_alignment_on_call more flexible when multiline parameters are used.
      Marcelo Fabri #1630 #1643

    • πŸ‘• Use the directory's .swiftlint.yml when --path is used.
      Marcelo Fabri #1631

  • v0.20.0 Changes

    πŸ’₯ Breaking
    • None.
    ✨ Enhancements
    • Detect more violations of force_unwrapping when using subscripts.
      OtΓ‘vio Lima

    • Match (Void) as return type in the void_return rule.
      Anders Hasselqvist

    • βž• Add multiline_parameters opt-in rule that warns to either keep all the parameters of a method or function on the same line, or one per line.
      Ornithologist Coder

    • Update function_parameter_count rule to ignore overridden methods.
      Markus Gasser #1562

    • Skip files with valid cache & no violations when auto correcting.
      Marcelo Fabri #1554

    • Don't trigger violations from the private_unit_test rule when a method has parameters.
      Marcelo Fabri #1532

    • Don't trigger violations from the discarded_notification_center_observer rule when the observer is being returned from a function that is not marked as @discardableResult.
      Marcelo Fabri #1525

    • Add extension_access_modifier opt-in rule validating that if all the declarations in a given extension have the same Access Control Level, the ACL keyword should be applied to the top-level extension.
      Marcelo Fabri #1546

    • Add vertical_parameter_alignment_on_call opt-in rule that validates that parameters are vertically aligned on a method call.
      Marcelo Fabri #1037

    • Add code_literal and image_literal boolean configuration options to object_literal rule. They allow to only check for one or the other literal type instead of both together.
      Cihat GΓΌndΓΌz #1587

    πŸ› Bug Fixes
    • Fix false positive in empty_enum_arguments rule when calling methods.
      Marcelo Fabri #1597

    • Fix crash in unused_closure_parameter rule when using unicode identifiers.
      Woo-Sik Byun Marcelo Fabri

    • πŸ›  Fix two false positives in force_unwrapping rule.
      OtΓ‘vio Lima #614 #977 #1614

    • πŸ›  Fix custom rules not working correctly with comment commands.
      JP Simard #1558

    • πŸ›  Fix incorrectly using configuration files named .swiftlint.yml when they are located in the same directory as a differently-named, user-provided custom configuration file.
      JP Simard #1531

    • πŸ›  Fix empty_count rule false positive in words that include "count".
      Marcelo Fabri #1622

    • Use validates_start_with_lowercase key when decoding configurations for generic_type_name, identifier_name and type_name rules. This key was used on the docs, but internally validates_start_lowercase was used.
      Marcelo Fabri #1626

  • v0.19.0 Changes

    πŸ’₯ 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

  • v0.18.1 Changes

    πŸ’₯ Breaking
    • None.
    ✨ Enhancements
    • None.
    πŸ› Bug Fixes
    • πŸš€ Compile releases in the 'Release' configuration rather than 'Debug'.
  • v0.18.0 Changes

    πŸ’₯ Breaking
    • πŸ‘• Replace YamlSwift with Yams. SwiftLint no longer includes YamlSwift. If your project implicitly depends on YamlSwift, you need to modify it to depend on YamlSwift explicitly.
      norio-nomura #1412

    • Yams interprets YAML more strictly than YamlSwift, so if your YAML configurations previously worked with SwiftLint but didn't fully conform to the YAML 1.2 standard, you'll need to fix those validation errors. For example:

      custom_rules:
      wrong_regex:
        name: "wrong regex"
        regex: "((assert|precondition)\(false)" # '\' in "" means escape sequence
      strict_regex:
        name: "strict regex"
        regex: '((assert|precondition)\(false)' # Use single quotes
      
    ✨ Enhancements
    • πŸ‘Œ Support compiling with Xcode 8.3 and Swift 3.1.
      Keith Smiley

    • πŸ›  Fix false positives on for_where rule and skip violation on complex conditions.
      Marcelo Fabri #1387

    • πŸ”§ Print YAML configuration errors in locatable format compatible with Xcode's Issue Navigator.

    πŸ› Bug Fixes
  • v0.17.0 Changes

    πŸ’₯ Breaking
    • variable_name rule (VariableNameRule) is now identifier_name (IdentifierNameRule) as it validates other identifiers as well.
      Marcelo Fabri #663

    • πŸ›  Fix sorted_imports rule to sort ignoring case.
      Keith Smiley #1185

    • πŸ‘• Temporarily disable cache when linting. This will be re-enabled in a future version after important cache-related issues have been addressed.
      Marcelo Fabri

    ✨ Enhancements
    • Add implicitly_unwrapped_optional opt-in rule that warns against using implicitly unwrapped optionals, except cases when this IUO is an IBOutlet.
      Siarhei Fedartsou #56

    • Performance improvements to generic_type_name, redundant_nil_coalescing, mark, first_where and vertical_whitespace rules.
      Marcelo Fabri

    • Add discarded_notification_center_observer rule that warns when the result of NotificationCenter.addObserver(forName:object:queue:using:) is not stored so it can be removed later.
      Marcelo Fabri #1062

    • Add notification_center_detachment rule that warns against an object removing itself from NotificationCenter in an unsafe location.
      Marcelo Fabri #1061

    • Accept AnyObject and NSObjectProtocol in class_delegate_protocol.
      Jon Shier #1261

    • Add ignores_function_declarations and ignores_comments as options to LineLengthRule.
      Michael L. Welles #598 #975

    • βž• Add for_where rule that validates that where is used in a for loop instead of a single if expression inside the loop.
      Marcelo Fabri #1228

    • unused_enumerated rule now warns when only the index is being used. You should use .indices instead of .enumerated() in this case.
      Marcelo Fabri #1278

    • Add ignores_case_statements as option to CyclomaticComplexityRule.
      Michael L. Welles #1298

    • Add correctable redundant_discardable_let rule that warns when let _ = foo() is used to discard a result from a function instead of _ = foo().
      Marcelo Fabri #1232

    • Accept global and local variables in implicit_getter rule.
      Marcelo Fabri

    • βž• Add --enabled (or -e) switch to the rules CLI command, to only display enabled rules.
      Natan Rolnik #1270

    • πŸ”§ Now nesting rule can be configured with a type and statement level.
      Hayashi Tatsuya #1318

    • Add explicit_type_interface opt-in rule that validates that the properties have an explicit type interface.
      Kim de Vos

    • βž• Add --lenient CLI option to lint command. Facilitates running a lint task that doesn't fail a pipeline of other tasks.
      aaroncrespo #1322

    • Add fatal_error_message opt-in rule that validates that fatalError() calls have a message.
      Kim de Vos #1348

    πŸ› Bug Fixes
    • πŸ›  Fix crashes when accessing cached regular expressions when linting in parallel.
      JP Simard #1344

    • πŸ›  Fix a false positive on large_tuple rule when using closures.
      Marcelo Fabri #1234

    • πŸ›  Fix force_unwrap false positive for bool negation.
      Aaron McTavish #918

    • πŸ›  Fix false positive and wrong correction on number_separator rule.
      Marcelo Fabri #1242

    • Retain closure parameter types when they are specified during autocorrect.
      Allen Zeng #1175

    • Fix redundant_void_return matches if return type starts with Void~.
      Hayashi Tatsuya

    • Ignore unused_closure_parameter rule on closures that are called inline.
      Marcelo Fabri #1161

    • πŸ“„ Disable valid_docs and missing_docs rules when running in Swift 2.3 or later as they have not been updated to work with those versions of Swift. Both rules are now opt-in because of this.
      JP Simard #728

    • πŸ›  Fix false positive on large_tuple rule when using generics inside a tuple.
      Marcelo Fabri #1257

    • 0️⃣ Make ASTRule default implementation to navigate through the substructure even if its children are from a different kind. This fixes some violations not being reported in some contexts.
      Marcelo Fabri #1237

    • Reimplement switch_case_on_newline rule to be an ASTRule and be more reliable, fixing some false negatives and false positives.
      Marcelo Fabri #1268

    • Fix closure_end_indentation rule false positive when using single-line closures.
      Marcelo Fabri #1216

    • πŸ›  Fix todo rule messages when the comment is not on a new line.
      Marcelo Fabri #1304

    • Fix false negative on unused_closure_parameter rule.
      Hayashi Tatsuya

    • πŸ›  Fix checkstyle report format.
      Yuki Oya

  • v0.16.1 Changes

    πŸ’₯ Breaking
    • None.
    ✨ Enhancements
    πŸ› Bug Fixes
    • πŸ›  Fix false positives on shorthand_operator rule.
      Marcelo Fabri #1156 #1163

    • Fix false positive on redundant_optional_initialization rule.
      Marcelo Fabri #1159

    • Fix false positive on operator_usage_whitespace rule with decimal literals in exponent format.
      Marcelo Fabri #1153

    • πŸ›  Fix excluded configuration not excluding files.
      Marcelo Fabri #1166

    • Disable commutative operations on shorthand_operator rule.
      Marcelo Fabri #1182 #1183 #1211

    • πŸ›  Fix crash when running in a Sandboxed environment, which also fixes Homebrew distribution. Set the SWIFTLINT_SWIFT_VERSION environment variable to either 2 or 3 to force that operation mode, bypassing the Swift version determined from SourceKit.
      JP Simard

  • v0.16.0 Changes

    πŸ’₯ Breaking
    • Several API breaking changes were made to conform to the Swift 3 API Design Guidelines. We apologize for any inconvenience this may have caused.
    ✨ Enhancements
    • πŸ‘• Speed up linting by caching linter results across invocations.
      Marcelo Fabri #868

    • πŸ‘• Speed up linting by processing multiple files and rules concurrently.
      JP Simard #1077

    • πŸ‘• Make many operations in SwiftLintFramework safe to call in multithreaded scenarios, including accessing Linter.styleViolations.
      JP Simard #1077

    • Permit unsigned and explicitly-sized integer types in valid_ibinspectable
      Daniel Duan

    • πŸ‘‰ Make nimble_operator rule correctable.
      Vojta Stavik

    • Add vertical_parameter_alignment rule that checks if parameters are vertically aligned for multi-line function declarations.
      Marcelo Fabri #1033

    • βž• Add more helpful reason strings to TrailingCommaRule.
      Matt Rubin

    • Add class_delegate_protocol rule that warns against protocol declarations that aren't marked as : class or @objc.
      Marcelo Fabri #1039

    • Add correctable redundant_optional_initialization rule that warns against initializing optional variables with nil.
      Marcelo Fabri #1052

    • redundant_nil_coalescing rule is now correctable.
      Marcelo Fabri

    • πŸ‘‰ Make number_separator rule correctable.
      Marcelo Fabri

    • empty_parentheses_with_trailing_closure rule is now correctable.
      Marcelo Fabri

    • Add correctable redundant_void_return rule that warns against explicitly adding -> Void to functions.
      Marcelo Fabri #1066

    • βž• Add an opt-in rule that enforces alphabetical sorting of imports.
      Scott Berrevoets #900

    • type_name rule forces enum values to be UpperCamelCase again when used with Swift 2.3.
      Marcelo Fabri #1090

    • πŸ‘‰ Make weak_delegate rule ignore computed properties.
      Rafael Machado #1089

    • βž• Add object_literal opt-in rule that warns against using image and color inits that can be replaced for #imageLiteral or #colorLiteral in Swift 3.
      Marcelo Fabri #1060

    • πŸ”§ Now number_separator rule can be configured with a minimum length.
      Marcelo Fabri #1109

    • Add compiler_protocol_init rule that flags usage of initializers declared in protocols used by the compiler such as ExpressibleByArrayLiteral that shouldn't be called directly. Instead, you should use a literal anywhere a concrete type conforming to the protocol is expected by the context.
      Marcelo Fabri #1096

    • βž• Add large_tuple configurable rule that validates that tuples shouldn't have too many members.
      Marcelo Fabri #1065

    • Add generic_type_name rule that validates generic constraint type names.
      Marcelo Fabri #51

    • ⚑️ Update vertical_whitespace rule to allow configuration of the number of consecutive empty lines before a violation using max_empty_lines. The default value is still 1 line.
      Aaron McTavish #769

    • Add check to ignore urls in line_length rule when ignores_urls configuration is enabled.
      Javier HernΓ‘ndez #384

    • βž• Add shorthand_operator rule that validates that shorthand operators should be used when possible.
      Marcelo Fabri #902

    • πŸ‘ Allow specifying a swiftlint_version configuration key which will log a warning if the current running version of SwiftLint is different than this value.
      JP Simard #221

    • βž• Add internal support for deprecated rule aliases.
      Marcelo Fabri #973

    • Add unused_optional_binding rule that will check for optional bindings not being used.
      Rafael Machado #1116

    πŸ› Bug Fixes
    • Ignore close parentheses on vertical_parameter_alignment rule.
      Marcelo Fabri #1042

    • πŸ›  syntactic_sugar rule now doesn't flag declarations that can't be fixed.
      Marcelo Fabri #928

    • Fix false positives on closure_parameter_position and unused_closure_parameter rules with Swift 2.3.
      Marcelo Fabri #1019

    • πŸ›  Fix crash on trailing_comma rule with Swift 2.3.
      Marcelo Fabri #921

    • πŸ›  Fix out of range exception in AttributesRule.
      JP Simard #1105

    • Fix variable_name and type_name rules on Linux.
      Marcelo Fabri

    • πŸ›  Fix linting directories with names ending with .swift.
      JP Simard

    • πŸ›  Fix running swiftlint version when building with Swift Package Manager.
      Marcelo Fabri #1045

    • Fix false positive on vertical_parameter_alignment rule when breaking line in a default parameter declaration.
      Marcelo Fabri #1129

  • v0.15.0 Changes

    πŸ’₯ Breaking
    • ⚠ line_length rule now has a default value of 120 for warnings.
      Marcelo Fabri #1008
    ✨ Enhancements
    • Add closure_end_indentation opt-in rule that validates closure closing braces according to these rules:
      • If the method call has chained breaking lines on each method (. is on a new line), the closing brace should be vertically aligned with the ..
      • Otherwise, the closing brace should be vertically aligned with the beginning of the statement in the first line.

    Marcelo Fabri #326

    • operator_usage_whitespace rule is now correctable.
      Marcelo Fabri

    • 🐎 implicit_getter and mark rule performance improvements.
      Marcelo Fabri

    • HTML reports now display a relative path to files.
      Jamie Edge

    • colon rule now validates colon position in dictionaries too. You can disable this new validation with the apply_to_dictionaries configuration.
      Marcelo Fabri #603

    • βž• Add first_where opt-in rule that warns against using .filter { /* ... */ }.first in collections, as .first(where: { /* ... */ }) is often more efficient.
      Marcelo Fabri #1005

    πŸ› Bug Fixes
  • v0.14.0 Changes

    πŸ’₯ 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