0.43.0
版本发布时间: 2021-03-04 05:02:02
realm/SwiftLint最新发布版本:0.57.0(2024-09-09 00:02:39)
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 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 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.
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 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 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
1、 portable_swiftlint.zip 6.61MB
2、 SwiftLint.pkg 6.6MB
3、 swiftlint_linux.zip 25.17MB