SwiftLint v0.39.0 Release Notes
Release Date: 2020-02-11 // about 4 years ago-
๐ฅ Breaking
Replace all uses of
Int
/Int64
/NSRange
representing byte offsets to use newly introducedByteCount
andByteRange
values instead. This will minimize the risk of accidentally using a byte-based offset in character-based contexts.
Paul Taykalo JP Simard๐ SwiftLint now imports SwiftSyntax and requires Xcode 11.0 to build.
Marcelo Fabri
Experimental
- None.
โจ Enhancements
โ Add option to pass successfully if no files passed to SwiftLint are lintable.
thedavidharris #2608iAdd
deinitializer
type content totype_contents_order
rule instead of grouping it with initializers.
Steven Magdy๐ Inline test failure messages to make development of SwiftLint easier. Test failures in triggering and non-triggering examples will appear inline in their respective files so you can immediately see which cases are working and which are not.
ZevEisenberg #3040Introduce a new
SyntaxRule
that enables writing rules using SwiftSyntax.
Marcelo Fabriโ Add
tuple_pattern
opt-in rule to warn against using assigning variables through a tuple pattern when the left side of the assignment contains labels.
Marcelo Fabri #2203Add
return_value_from_void_function
opt-in rule to warn against usingreturn <expression>
in a function that isVoid
.
Marcelo FabriAdd
void_function_in_ternary
opt-in rule to warn against using a ternary operator to callVoid
functions.
Marcelo Fabri #2358Add
only_after_dot
configuration option toempty_count
rule. With the option enabled,empty_count
rule will ignore variables namedcount
. By default, this option is disabled.
Zsolt Kovรกcs #827Add
prohibited_nan_comparison
opt-in rule to validate usingisNaN
instead of comparing values to the.nan
constant.
Marcelo Fabri #2086Add case
preview_provider
to the order list offile_types_order
to fix an issue with false positives forPreviewProvider
subclasses in SwiftUI.
Cihat Gรผndรผz #2860
๐ Bug Fixes
๐ Fix false positive in
attributes
rule with@autoclosure
parameters when using Swift 5.2.
Mateusz Matrejek #3079Fix
discarded_notification_center_observer
false positives when capturing observers into an array.
Petteri Huusko๐ Fix crash when non-closed #if was present in file.
PaulTaykalo๐ Fix false positives when line ends with carriage return + line feed.
John Mueller #3060Implicit_return description now reports current config correctly. John Buckley
๐ Fix false positive in
implicit_getter
rule in extensions when using Swift 5.2.
Marcelo Fabri #3074Do not trigger
optional_enum_case_matching
rule on_?
as the?
might be required in some situations.
Marcelo Fabri #3057๐ Fix false positive in
attributes
rule with@escaping
parameters when using Swift 5.2.
Marcelo Fabri #3079๐ Fix false positive in
empty_string
rule when using multiline string literals.
Marcelo Fabri #3100