0.43.0-rc.4
版本发布时间: 2021-02-27 04:09:58
realm/SwiftLint最新发布版本:0.57.0(2024-09-09 00:02:39)
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: https://github.com/realm/SwiftLint/compare/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 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 -
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 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 -
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 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
1、 portable_swiftlint.zip 6.56MB
2、 SwiftLint.pkg 13.12MB
3、 swiftlint_linux.zip 25.13MB