SwiftLint v0.43.0 Release Notes
-
๐ฅ Breaking
๐ป The command line syntax has slightly changed due to migrating from the Commandant command line parsing library to swift-argument-parser. For the most part the breaking changes are all to make the syntax more unix compliant and intuitive to use. For example, commands such as
swiftlint --help
orswiftlint -h
now work as expected. The help output from various commands has greatly improved as well. Notably:swiftlint autocorrect
was removed in favor ofswiftlint --fix
. Previous commands should continue to work temporarily to help with the transition. Please let us know if there's a command that no longer works and we'll attempt to add a bridge to help with its transition.
JP Simard๐ง Configuration files now consistently have their
included
/excluded
relative file paths applied relative to their location in the file system. Previously the root configuration file applied these relative to the current working directory, but nested configurations applied these to their location in the file system.
Frederick Pietschmann JP SimardThe
discarded_notification_center_observer
is now opt-in due to some difficult to resolve false positives, such as #3498.
JP Simard
Experimental
- None.
โจ Enhancements
Added
allows_single_line
option inmultiline_parameters
rule configuration. Defaults totrue
. This enforces parameters in a method with multiple parameters to always be in different lines.
Otavio Cordeiro๐ Support relative paths in compilation databases for SwiftLint analyzer rules.
JP Simardโ Add opt-in rule
discouraged_assert
to encourage the use ofassertionFailure()
and/orpreconditionFailure()
overassert(false)
.
Otavio Cordeiroโ Adds
balanced_xctest_lifecycle
opt-in rule to enforce balancedsetUp
andtearDown
methods in a test class.
Otavio Cordeiro #3452๐ Tweak the auto-correction result console output for clarity.
mokagio #3522๐ Allow configuring related USRs to skip in UnusedDeclarationRule by specifying a list of USRs in the
related_usrs_to_skip
key. For example you might have custom source tooling that does something with types conforming to a procotol even if that type is never explicitly referenced by other code.
JP Simard๐ Make
strong_iboutlet
rule correctable.
MaxHaertwigAdd
legacy_objc_type
opt-in rule to warn against using bridged Objective-C reference types instead of Swift value types.
Blake #2758๐ Support Swift Playground control comments in the
comment_spacing
rule.
Thomas Goyne๐ [Internal] Integrate OS Signposts to help profile SwiftLint performance.
jpsimโก๏ธ Update CodeClimateReporter to produce relative paths.
bmwaltersAdd Bool violation reporting in
redundant_type_annotation
.
Artem Garmash #3423โ Add a new
capture_variable
analyzer rule to warn about listing a non-constant (var
) variable in a closure's capture list. This captures the variable's value at closure creation time instead of closure call time, which may be unexpected.
Laszlo Kustra๐ฒ Log references to a specified module when running the
unused_import
by setting theSWIFTLINT_LOG_MODULE_USAGE=<module-name>
environment variable when running analyze.
jpsimโ Add opt-in rule
private_subject
rule which warns against public Combine subjects.
Otavio Cordeiro
๐ Bug Fixes
๐ Fix
custom_rules
merging when the parent configuration is based ononly_rules
.
Frederick Pietschmann #3468๐ Fix misleading warnings about rules defined in the
custom_rules
not being available (when using multiple configurations).
Frederick Pietschmann #3472๐ Fix bug that prevented the reconfiguration of a custom rule in a child config.
Frederick Pietschmann #3477๐ Fix typos in configuration options for
file_name
rule.
advantis๐ Fix issue that prevented the inclusion of a configuration file from a parent folder.
Frederick Pietschmann #3485๐ Fix violation location and misplaced corrections for some function references in
explicit_self
rule.
JP Simard๐ Fix false positives with result builders in
unused_declaration
.
JP SimardFind more unused declarations in
unused_declaration
.
JP Simard๐ Fix parsing xcode logs for analyzer rules for target names with spaces.
JP Simard #3021