SwiftLint v0.14.0 Release Notes
-
π₯ 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 theLINUX_SOURCEKIT_LIB_PATH
environment variable. A preconfigured Docker image is available on Docker Hub by the ID ofnorionomura/sourcekit:302
.
JP Simard Norio Nomura #732Add
dynamic_inline
rule to discourage combination of@inline(__always)
anddynamic
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 #844FunctionParameterCountRule
now ignores initializers.
Denis Lebedev #544β Add
EmojiReporter
: a human friendly reporter.
MichaΕ KaΕuΕΌnyAdd
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 thealways_on_same_line
andalways_on_line_above
keys.
- If the attribute is
Add
empty_parentheses_with_trailing_closure
rule that checks for empty parentheses after method call when using trailing closures.
Marcelo Fabri #885Add
closure_parameter_position
rule that validates that closure parameters are in the same line as the opening brace.
Marcelo Fabri #931type_name
rule now validatestypealias
andassociatedtype
too.
Marcelo Fabri #49 #956β Add
ProhibitedSuperRule
opt-in rule that warns about methods calling to super that should not, for exampleUIViewController.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() ->
overVoid ->
.
Marcelo Fabri #573Add
operator_usage_whitespace
opt-in rule to validate that operators are surrounded by a single whitespace when they are being used.
Marcelo Fabri #626Add
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 indelegate
.
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
- π 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.