Releases: realm/SwiftLint
0.43.0: Clothes Line Interface
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 of
swiftlint --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 Simard -
The
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 of
assertionFailure()
and/orpreconditionFailure()
over
assert(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 therelated_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.
MaxHaertwig -
Add
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.
bmwalters -
Add 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 on
only_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 inexplicit_self
rule.
JP Simard -
Fix false positives with result builders in
unused_declaration
.
JP Simard -
Find more unused declarations in
unused_declaration
.
JP Simard -
Fix parsing xcode logs for analyzer rules for target names with
spaces.
JP Simard
#3021
0.43.0-rc.4: Clothes Line Interface
This is a prerelease version. It won't be published to Homebrew or CocoaPods. But there are many other ways to install:
- Downloading the attached
SwiftLint.pkg
installer and launching it - Downloading the attached
portable_swiftlint.zip
archive, extracting it and moving the binary fromportable_swiftlint/swiftlint
to/usr/local/bin
or elsewhere in yourPATH
- Using Mint:
mint install realm/SwiftLint@0.43.0-rc.4
- Cloning and building from source:
git clone https://github.com/realm/SwiftLint.git && cd SwiftLint && git checkout 0.43.0-rc.4 && make install
Changes from 0.43.0-rc.3: 0.43.0-rc.3...0.43.0-rc.4
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 of
swiftlint --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 Simard -
The
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 of
assertionFailure()
and/orpreconditionFailure()
over
assert(false)
.
Otavio Cordeiro -
Add opt-in rule
private_subject
rule which warns against
public Combine subjects.
Otavio Cordeiro -
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 therelated_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.
MaxHaertwig -
Add
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.
bmwalters -
Add Bool violation reporting in
redundant_type_annotation
.
Artem Garmash
#3423 -
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
Bug Fixes
-
Fix
custom_rules
merging when the parent configuration is based on
only_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 inexplicit_self
rule.
JP Simard -
Fix false positives with result builders in
unused_declaration
.
JP Simard
0.43.0-rc.3: Clothes Line Interface
This is a prerelease version. It won't be published to Homebrew or CocoaPods. But there are many other ways to install:
- Downloading the attached
SwiftLint.pkg
installer and launching it - Downloading the attached
portable_swiftlint.zip
archive, extracting it and moving the binary fromportable_swiftlint/swiftlint
to/usr/local/bin
or elsewhere in yourPATH
- Using Mint:
mint install realm/SwiftLint@0.43.0-rc.3
- Cloning and building from source:
git clone https://github.com/realm/SwiftLint.git && cd SwiftLint && git checkout 0.43.0-rc.3 && make install
Changes from 0.43.0-rc.2: 0.43.0-rc.2...0.43.0-rc.3
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 of
swiftlint --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
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 of
assertionFailure()
and/orpreconditionFailure()
over
assert(false)
.
Otavio Cordeiro -
Add opt-in rule
private_subject
rule which warns against
public Combine subjects.
Otavio Cordeiro -
Allow configuring related USRs to skip in UnusedDeclarationRule by
specifying a list of USRs in therelated_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
Bug Fixes
0.43.0-rc.2: Clothes Line Interface
This is a prerelease version. It won't be published to Homebrew or CocoaPods. But there are many other ways to install:
- Downloading the attached
SwiftLint.pkg
installer and launching it - Downloading the attached
portable_swiftlint.zip
archive, extracting it and moving the binary fromportable_swiftlint/swiftlint
to/usr/local/bin
or elsewhere in yourPATH
- Using Mint:
mint install realm/SwiftLint@0.43.0-rc.2
- Cloning and building from source:
git clone https://github.com/realm/SwiftLint.git && cd SwiftLint && git checkout 0.43.0-rc.2 && make install
Changes from 0.43.0-rc.1: 0.43.0-rc.1...0.43.0-rc.2
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 of
swiftlint --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
Experimental
- None.
Enhancements
-
Support relative paths in compilation databases for SwiftLint analyzer
rules.
JP Simard -
Add opt-in rule
discouraged_assert
to encourage the use of
assertionFailure()
and/orpreconditionFailure()
over
assert(false)
.
Otavio Cordeiro
Bug Fixes
0.43.0-rc.1: Clothes Line Interface
This is a prerelease version. It won't be published to Homebrew or CocoaPods. But there are many other ways to install:
- Downloading the attached
SwiftLint.pkg
installer and launching it - Downloading the attached
portable_swiftlint.zip
archive, extracting it and moving the binary fromportable_swiftlint/swiftlint
to/usr/local/bin
or elsewhere in yourPATH
- Using Mint:
mint install realm/SwiftLint@0.43.0-rc.1
- Cloning and building from source:
git clone https://github.com/realm/SwiftLint.git && cd SwiftLint && git checkout 0.43.0-rc.1 && make install
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 of
swiftlint --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
Experimental
- None.
Enhancements
- Support relative paths in compilation databases for SwiftLint analyzer
rules.
JP Simard
Bug Fixes
- Fix typos in configuration options for
file_name
rule.
advantis
0.42.0: He Chutes, He Scores
Breaking
-
SwiftLint now requires Swift 5.2 or higher to build.
JP Simard -
SwiftLintFramework can no longer be integrated as a Carthage
depdendency.
JP Simard
#3412 -
SwiftLint.xcworkspace
andSwiftLint.xcproject
have been completely
removed. You can still use Xcode to develop SwiftLint by opening it as
a Swift Package by typingxed .
orxed Package.swift
from your
shell.
JP Simard
#3412 -
Renamed
statement_level
tofunction_level
innesting
rule
configuration.
Skoti -
Separated
type_level
andfunction_level
counting innesting
rule.
Skoti
#1151 -
function_level
innesting
rule defaults to 2 levels.
Skoti -
Added
check_nesting_in_closures_and_statements
innesting
rule to
search for nested types and functions within closures and statements.
Defaults totrue
.
Skoti -
Renamed
OverridenSuperCallConfiguration
to
OverriddenSuperCallConfiguration
.
Bryan Ricker
#3426
Experimental
- None.
Enhancements
-
Don't report
@UIApplicationDelegateAdaptor
statements inweak-delegate
rule.
Richard Turton
#3286 -
Don't report
unavailable_function
violations for functions returning
Never
.
Artem Garmash
#3286 -
Added
always_allow_one_type_in_functions
option innesting
rule
configuration. Defaults tofalse
. This allows to nest one type
within a function even if breaking the maximumtype_level
.
Skoti
#1151 -
Add option to specify a
child_config
/parent_config
file
(local or remote) in any SwiftLint configuration file.
Allow passing multiple configuration files via the command line.
Improve documentation for multiple configuration files.
Frederick Pietschmann
#1352 -
Add an
always_keep_imports
configuration option for the
unused_import
rule.
Keith Smiley -
Add
comment_spacing
rule.
Noah Gilmore
#3233 -
Add
codeclimate
reporter to generate JSON reports in codeclimate
format. Could be used for GitLab Code Quality MR Widget.
jkroepke
#3424 -
Add an
override_allowed_terms
configuration parameter to the
inclusive_language
rule, with a default value ofmastercard
.
Dalton Claybrook
#3415
Bug Fixes
- Remove
@IBOutlet
and@IBInspectable
from UnusedDeclarationRule.
Keith Smiley
#3184
0.42.0-rc.2
This is a prerelease version. It won't be published to Homebrew or CocoaPods. But there are many other ways to install:
- Downloading the attached
SwiftLint.pkg
installer and launching it - Downloading the attached
portable_swiftlint.zip
archive, extracting it and moving the binary fromportable_swiftlint/swiftlint
to/usr/local/bin
or elsewhere in yourPATH
- Using Mint:
mint install realm/SwiftLint@0.42.0-rc.2
- Cloning and building from source:
git clone https://github.com/realm/SwiftLint.git && cd SwiftLint && git checkout 0.42.0-rc.2 && make install
Changes from 0.42.0-rc.1: 0.42.0-rc.1...0.42.0-rc.2
Breaking
-
SwiftLint now requires Swift 5.2 or higher to build.
JP Simard -
SwiftLintFramework can no longer be integrated as a Carthage
depdendency.
JP Simard
#3412 -
SwiftLint.xcworkspace
andSwiftLint.xcproject
have been completely
removed. You can still use Xcode to develop SwiftLint by opening it as
a Swift Package by typingxed .
orxed Package.swift
from your
shell.
JP Simard
#3412 -
Renamed
statement_level
tofunction_level
innesting
rule
configuration.
Skoti -
Separated
type_level
andfunction_level
counting innesting
rule.
Skoti
#1151 -
function_level
innesting
rule defaults to 2 levels.
Skoti -
Added
check_nesting_in_closures_and_statements
innesting
rule to
search for nested types and functions within closures and statements.
Defaults totrue
.
Skoti -
Renamed
OverridenSuperCallConfiguration
to
OverriddenSuperCallConfiguration
.
Bryan Ricker
#3426
Experimental
- None.
Enhancements
-
Don't report
@UIApplicationDelegateAdaptor
statements inweak-delegate
rule.
Richard Turton
#3286 -
Don't report
unavailable_function
violations for functions returning
Never
.
Artem Garmash
#3286 -
Added
always_allow_one_type_in_functions
option innesting
rule
configuration. Defaults tofalse
. This allows to nest one type
within a function even if breaking the maximumtype_level
.
Skoti
#1151 -
Add option to specify a
child_config
/parent_config
file
(local or remote) in any SwiftLint configuration file.
Allow passing multiple configuration files via the command line.
Improve documentation for multiple configuration files.
Frederick Pietschmann
#1352 -
Add an
always_keep_imports
configuration option for the
unused_import
rule.
Keith Smiley -
Add
comment_spacing
rule.
Noah Gilmore
#3233 -
Add
codeclimate
reporter to generate JSON reports in codeclimate
format. Could be used for GitLab Code Quality MR Widget.
jkroepke
#3424 -
Add
non_private_xctest_member
rule.
Keith Smiley -
Add an
override_allowed_terms
configuration parameter to the
inclusive_language
rule, with a default value ofmastercard
.
Dalton Claybrook
#3415
Bug Fixes
- Remove
@IBOutlet
and@IBInspectable
from UnusedDeclarationRule.
Keith Smiley
#3184
0.42.0-rc.1
This is a prerelease version. It won't be published to Homebrew or CocoaPods. But there are many other ways to install:
- Downloading the attached
SwiftLint.pkg
installer and launching it - Downloading the attached
portable_swiftlint.zip
archive, extracting it and moving the binary fromportable_swiftlint/swiftlint
to/usr/local/bin
or elsewhere in yourPATH
- Using Mint:
mint install realm/SwiftLint@0.42.0-rc.1
- Cloning and building from source:
git clone https://github.com/realm/SwiftLint.git && cd SwiftLint && git checkout 0.42.0-rc.1 && make install
Breaking
-
SwiftLint now requires Swift 5.2 or higher to build.
JP Simard -
SwiftLintFramework can no longer be integrated as a Carthage
depdendency.
JP Simard
#3412 -
SwiftLint.xcworkspace
andSwiftLint.xcproject
have been completely
removed. You can still use Xcode to develop SwiftLint by opening it as
a Swift Package by typingxed .
orxed Package.swift
from your
shell.
JP Simard
#3412 -
Renamed
statement_level
tofunction_level
innesting
rule
configuration.
Skoti -
Separated
type_level
andfunction_level
counting innesting
rule.
Skoti
#1151 -
function_level
innesting
rule defaults to 2 levels.
Skoti -
Added
check_nesting_in_closures_and_statements
innesting
rule to
search for nested types and functions within closures and statements.
Defaults totrue
.
Skoti -
Renamed
OverridenSuperCallConfiguration
to
OverriddenSuperCallConfiguration
.
Bryan Ricker
#3426
Experimental
- None.
Enhancements
-
Don't report
unavailable_function
violations for functions returning
Never
.
Artem Garmash
#3286 -
Added
always_allow_one_type_in_functions
option innesting
rule
configuration. Defaults tofalse
. This allows to nest one type
within a function even if breaking the maximumtype_level
.
Skoti
#1151 -
Add option to specify a
child_config
/parent_config
file
(local or remote) in any SwiftLint configuration file.
Allow passing multiple configuration files via the command line.
Improve documentation for multiple configuration files.
Frederick Pietschmann
#1352 -
Add an
always_keep_imports
configuration option for the
unused_import
rule.
Keith Smiley -
Add
comment_spacing
rule.
Noah Gilmore
#3233 -
Add
codeclimate
reporter to generate JSON reports in codeclimate
format. Could be used for GitLab Code Quality MR Widget.
jkroepke
#3424 -
Add
non_private_xctest_member
rule.
Keith Smiley -
Add an
override_allowed_terms
configuration parameter to the
inclusive_language
rule, with a default value ofmastercard
.
Dalton Claybrook
#3415
Bug Fixes
- Remove
@IBOutlet
and@IBInspectable
from UnusedDeclarationRule.
Keith Smiley
#3184
0.41.0: World’s Cleanest Voting Booth
Breaking
-
Changed behavior of
strict
option onlint
andanalyze
to treat
all warnings as errors instead of only changing the exit code.
Jeehut
#3312 -
Removed the
unneeded_notification_center_removal
rule because it was
based on an incorrect premise.
JP Simard
#3338 -
The
whitelist_rules
configuration key has been renamed to
only_rules
.
Dalton Claybrook
Experimental
- None.
Enhancements
-
Add
use-alternative-excluding
option to speed up linting in cases
described in #3325.
This option yields different exclusion behavior.
JohnReeze
#3304 -
Add
test_case_accessibility
rule.
Keith Smiley
#3376 -
Remove
@IBOutlet
and@IBInspectable
from UnusedDeclarationRule.
Keith Smiley
#3184 -
Add
allow_multiline_func
configuration option toopening_brace
rule, to allow placing{
on new line in case of multiline function.
Defaults tofalse
.
Zsolt Kovács
#1921 -
Update the
nslocalizedstring_key
rule to validate thecomment
argument in addition to thekey
argument.
Dalton Claybrook
#3334 -
Add
inclusive_language
rule to encourage the use of inclusive
language that avoids discrimination against groups of people.
Dalton Claybrook -
Add
prefer_nimble
opt-in rule to encourage using Nimble matchers
over the XCTest ones.
Marcelo Fabri
#3293 -
unused_closure_parameter
rule now validates closures outside of
function calls.
Marcelo Fabri
#1082 -
Improve documentation for running SwiftLint as Xcode build phase.
Christian Mitteldorf
#3169 -
Add
skip_aligned_constants
(defaults totrue
) and
lines_look_around
(defaults to2
) configuration parameters to the
operator_usage_whitespace
rule.
Paul Taykalo
#3388
Bug Fixes
-
Fix parsing of Xcode 12 compiler logs for analyzer rules.
JP Simard
#3365 -
Fix some SwiftUI unused declaration rule false positives.
JP Simard
#3365 -
Fix some false positives in rule
explicit_self
.
Sven Münnich -
Fix incorrect autocorrection in
prefer_zero_over_explicit_init
rule.
Paul Taykalo -
Rule
unused_capture_list
should not be triggered by unowned self
keyword.
hank121314
#3389 -
Fix severity configuration for
indentation_width
.
Samasaur1
#3346 -
Fix DuplicateImportsRule's support for import attributes.
Keith Smiley
#3402 -
Allow "allowed symbols" as first character in
identifier_name
.
JP Simard
#3306 -
Fix false positives with parameterized attributes in
attributes
.
JP Simard
#3316 -
Fix some missed cases in rule
unavailable_function
.
Quinn Taylor
#3374 -
Fix incorrect violation message for line length violations.
JP Simard
#3333 -
Fix inconsistency in
operator_usage_whitespace
rule.
Paul Taykalo
#3321 -
Fix false positives in
convenience_type
rule for types that cannot
be converted to enums.
ZevEisenberg
#3033 -
Fix finding a nested config when a single file path is passed.
Seth Friedman -
Fix incorrect calculation of the root path when a directory in the
tree is passed in as a path argument.
Seth Friedman
#3383 -
Fix rare false positive in
toggle_bool
rule.
Marcelo Fabri
#3398
0.40.3: Greased Up Drum Bearings
Breaking
- None.
Experimental
- None.
Enhancements
-
Make the
unused_declaration
rule run 3-5 times faster, and
enable it to detect more occurrences of unused declarations.
JP Simard -
Remove unneeded internal locking overhead, leading to increased
performance in multithreaded operations.
JP Simard -
Skip correcting file if the swift parser reports a warning or an
error.
JP Simard
#3343
Bug Fixes
-
Rule
unused_capture_list
should not be triggered by self keyword.
hank121314
#2367 -
Rule
multiple_closures_with_trailing_closure
no longer triggers when Swift
5.3's 'multiple trailing closures' feature is used.
Jumhyn
#3295