SwiftLint v0.21.0 Release Notes
-
๐ฅ 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
orperformance
. Currently this is just used for documentation purposes when you runswiftlint rules
orswiftlint generate-docs
.
Marcelo Fabriโ Add [rules documentation](Rules.md) generation.
Marcelo Fabri #1078Add
private_over_fileprivate
correctable rule to check for top-level usages offileprivate
and recommendprivate
instead. This is in line with SE-0169's goal "forfileprivate
to be used rarely". There is a also a newstrict_fileprivate
opt-in rule that will mark everyfileprivate
as a violation (especially useful with Swift 4).
Jose Cheyo Jimenez Marcelo Fabri #1469 #1058Add
let_var_whitespace
opt-in rule to enforce thatlet
/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 #1577Don't trigger
implicit_getter
violations when attributes (such asmutating
or@inline
) are present.
Marcelo Fabri #1309 #1589โ Add
--use-tabs
option toAutoCorrectOptions
, 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 #1647Add
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 toswiftlint rules
to print only rules that are not enabled in the configuration.
Marcelo FabriAdd
ignore_comment_only_lines
boolean configuration option tofile_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 #54Shebang (
#!
) in the beginning of a file is now ignored by all rules.
Marcelo Fabri #1294Add
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 #1512Treat
yes
,no
,on
andoff
as strings (and not booleans) when loading configuration files.
Marcelo Fabri #1424Add
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 usingwhile
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 #1029Fix false positive in
empty_enum_arguments
rule when using wildcards andwhere
clauses.
Marcelo Fabri #1722๐ Fix false positive in
large_tuple
rule when using throwing closure.
LiquidsoulMake
vertical_parameter_alignment
more robust, fixing false positives and detecting previously missed violations.
JP Simard #1488
- ๐ Xcode 8.3 or later and Swift 3.1 or later are required to build.