SwiftLint v0.17.0 Release Notes
-
๐ฅ Breaking
variable_name
rule (VariableNameRule
) is nowidentifier_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 #56Performance improvements to
generic_type_name
,redundant_nil_coalescing
,mark
,first_where
andvertical_whitespace
rules.
Marcelo FabriAdd
discarded_notification_center_observer
rule that warns when the result ofNotificationCenter.addObserver(forName:object:queue:using:)
is not stored so it can be removed later.
Marcelo Fabri #1062Add
notification_center_detachment
rule that warns against an object removing itself fromNotificationCenter
in an unsafe location.
Marcelo Fabri #1061Accept
AnyObject
andNSObjectProtocol
inclass_delegate_protocol
.
Jon Shier #1261Add
ignores_function_declarations
andignores_comments
as options toLineLengthRule
.
Michael L. Welles #598 #975โ Add
for_where
rule that validates thatwhere
is used in afor
loop instead of a singleif
expression inside the loop.
Marcelo Fabri #1228unused_enumerated
rule now warns when only the index is being used. You should use.indices
instead of.enumerated()
in this case.
Marcelo Fabri #1278Add
ignores_case_statements
as option toCyclomaticComplexityRule
.
Michael L. Welles #1298Add correctable
redundant_discardable_let
rule that warns whenlet _ = foo()
is used to discard a result from a function instead of_ = foo()
.
Marcelo Fabri #1232Accept global and local variables in
implicit_getter
rule.
Marcelo Fabriโ Add
--enabled
(or-e
) switch to therules
CLI command, to only display enabled rules.
Natan Rolnik #1270๐ง Now
nesting
rule can be configured with a type and statement level.
Hayashi Tatsuya #1318Add
explicit_type_interface
opt-in rule that validates that the properties have an explicit type interface.
Kim de Vosโ Add
--lenient
CLI option tolint
command. Facilitates running a lint task that doesn't fail a pipeline of other tasks.
aaroncrespo #1322Add
fatal_error_message
opt-in rule that validates thatfatalError()
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 #1242Retain closure parameter types when they are specified during autocorrect.
Allen Zeng #1175Fix
redundant_void_return
matches if return type starts with Void~.
Hayashi TatsuyaIgnore
unused_closure_parameter
rule on closures that are called inline.
Marcelo Fabri #1161๐ Disable
valid_docs
andmissing_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 #12570๏ธโฃ 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 #1237Reimplement
switch_case_on_newline
rule to be anASTRule
and be more reliable, fixing some false negatives and false positives.
Marcelo Fabri #1268Fix
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 #1304Fix false negative on
unused_closure_parameter
rule.
Hayashi Tatsuya๐ Fix
checkstyle
report format.
Yuki Oya