Changelog History
Page 1
-
v0.47.1 Changes
π₯ Breaking
- None.
Experimental
- None.
β¨ Enhancements
β Add type-checked analyzer rule version of
ArrayInitRule
namedTypesafeArrayInitRule
with identifiertypesafe_array_init
that avoids the false positives present in the lint rule.
SimplyDanny #3749β Add the
--in-process-sourcekit
command line flag tolint
andanalyze
commands, which has the same effect as setting theIN_PROCESS_SOURCEKIT
environment variable.
Juozas Valanciusβ Add a new
artifactbundle
release asset containingswiftlint
binaries for x86 & arm64 macOS.
Juozas Valancius #3840Add back
return_value_from_void_function
opt-in rule to warn against usingreturn <expression>
in a function that returnsVoid
.
Marcelo Fabriβ Don't skip autocorrect on files that have parser warnings. Only files with errors reported by the Swift parser will be skipped.
Marcelo Fabri #3343Add
accessibility_label_for_image
rule to warn if a SwiftUI Image does not have an accessibility label and is not hidden from accessibility.
Ryan Coleβ Add
unavailable_condition
rule to prefer usingif #unavailable
instead ofif #available
with an empty body and anelse
condition when using Swift 5.6 or later.
Marcelo Fabri #3897β Add
comma_inheritance
rule to validate that inheritance clauses use commas instead of&
.
Marcelo Fabri #3950
π Bug Fixes
Fix false positives in
unused_closure_parameter
when using parameters with backticks.
JP Simard #3628π Improved the
syntactic_sugar
rule's detection accuracy and fixed some corrections leading to invalid code.
Paul Taykalo #3866π Fix analyzer rules with Xcode 13.3 / Swift 5.6. Note that we've measured performance regressions compared to Swift 5.5 on the order of about 2x.
JP Simard #39200οΈβ£ Error by default on bad expiring todo date formatting.
Christopher Hale #3636Avoid false-positive in
let_var_whitespace
rule by allowing custom attributes on lines directly before let/var declarations.
SimplyDanny #2980π Lint/analyze all files listed in the command even if the
--path
option is used.
coffmark
-
v0.47.0 Changes
π₯ Breaking
π SwiftLint now requires Swift 5.5 or higher to build.
JP Simardπ The
SwiftLintFramework
podspec has been removed. To our knowledge, this was completely unused by other projects and was not worth the complexity needed to justify its continued maintenance, especially in light of the integration of SwiftSyntax. TheSwiftLint
podspec is still supported.
JP Simardπ SwiftLint now requires at least Swift 5.0 installed in order to lint files.
Marcelo Fabri
Experimental
- π The
force_cast
rule and the comment command parsing mechanism have been updated to use SwiftSyntax instead of SourceKit. Please report any problems you encounter by opening a GitHub issue. If this is successful, more rules may use Swift Syntax in the future.
JP Simard
β¨ Enhancements
Empty files no longer trigger any violations.
JP Simard #38540οΈβ£ The
legacy_random
rule is now enabled by default.
Marcelo Fabriπ The
deployment_target
rule now supports the#unavailable
syntax added in Swift 5.6.
Marcelo Fabri #3896π¨ Set the
IN_PROCESS_SOURCEKIT
environment variable, which will use the in-process version of sourcekitd on macOS when Xcode 13 or later is selected. This avoids the use of XPC, which is prohibited in some sandboxed environments, such as in Swift Package Manager plugins.
Juozas Valanciusβ Add ability to run only one (focused) example.
PaulTaykalo #3911
π Bug Fixes
Extend
class_delegate_protocol
to correctly identify cases with the protocol body opening brace on a new line.
Tobisaninfoπ Fix SwiftLint.pkg installer installing multiple copies of SwiftLint.
JP Simard #3815 #3887
-
v0.46.5 Changes
π₯ Breaking
- None.
Experimental
- None.
β¨ Enhancements
- None.
π Bug Fixes
Fix
empty_parentheses_with_trailing_closure
rule when using Swift 5.6.
Marcelo Fabri #3846Fix false negatives in
closure_parameter_position
rule with Swift 5.6.
Marcelo Fabri #3845π Fix regression in
last_where
rule when using Swift 5.6.
Marcelo Fabri #3847π Fix regression in
unused_import
rule when using Swift 5.6.
JP Simard #3849π Fix regression in
trailing_closure
rule when using Swift 5.6.
Marcelo Fabri #3848
-
v0.46.4 Changes
π₯ Breaking
- None.
Experimental
- None.
β¨ Enhancements
- None.
π Bug Fixes
Ignore meta class types in
prefer_self_in_static_references
rule.
SimplyDanny #3804Ignore MARK in multiline comment, fixing cases that would previously crash or produce invalid results when correcting.
goranche #1749 #3841π Fix false positive in
EmptyEnumArgumentsRule
rule when using Swift 5.6.
Marcelo Fabri #3850
-
v0.46.3 Changes
π₯ Breaking
- None.
Experimental
- None.
β¨ Enhancements
- π Change fingerprint generation in
CodeClimateReporter.swift
to use the relative file path to better support CI/CD on multiple machines.
HA Pors
π Bug Fixes
Fix crash in the
closure_end_indentation
rule when linting with Swift 5.6.
JP Simard #3830π Fix default rules section in documentation.
Natan Rolnik #3857
-
v0.46.2 Changes
π₯ Breaking
- None.
Experimental
- None.
β¨ Enhancements
- None.
π Bug Fixes
π Fix SwiftLint.pkg installer on macOS 11 or later.
JP Simard #3815Ignore
prefer_self_in_static_references
rule in extensions generally.
SimplyDanny #3775Fix
class_delegate_protocol
false positives when usingwhere
clause.
Steven Magdy
-
v0.46.1 Changes
π₯ Breaking
Experimental
- None.
β¨ Enhancements
π Official Docker images are now available. See the [Docker section of the README](README.md#docker) for usage instructions.
Francisco Javier Trujillo MataAllow
unused_setter_value
for overrides.
Adrian Debbeler #2585
π Bug Fixes
π Fix
convenience_type
false positives when using actors.
JP Simard #3770Fix false positives in the
prefer_self_in_static_references
rule.
SimplyDanny #3768π Fix the regex for expiring TODO comments.
Sergei Shirokov #3767π Fix crash when parsing multi-line attributes with the
attributes
rule.
JP Simard #3761Fix false positives in
unused_closure_parameter
when using list element bindings in SwiftUI.
Paul Williamson #3790π Fix the cache path not being properly set when using nested configurations.
AndrΓ©s Cecilia Luque
-
v0.45.1 Changes
π₯ Breaking
- None.
Experimental
- None.
β¨ Enhancements
π Update Rule list documentation to distinguish between opt-in and on-by-default rules.
Benny WongAdd opt-in
prefer_self_in_static_references
rule to warn if the type name is used to reference static members the same type. Prefer usingSelf
instead which is not affected by renamings.
SimplyDannyβ Add support for running SwiftLint as a pre-commit hook.
Jesse Crocker Hannes Ljungberg
π Bug Fixes
π Fix
unused_import
rule incorrectly consideringSwiftShims
as a used import.
JP Simardπ Fix false positives on
large_tuple
rule when usingasync
closures.
Kaitlin Mahar #3753Fix false positive on
legacy_objc_type
rule when using types with names that start with a legacy type name.
Isaac Ressler #3555
-
v0.45.0 Changes
π₯ Breaking
- π SwiftLint now requires Swift 5.4 or higher to build.
JP Simard
Experimental
- None.
β¨ Enhancements
Add
self_in_property_initialization
rule to catch uses ofself
inside an inline closure used for initializing a variable. In this case,self
refers to theNSObject.self
method and likely won't be what you expect. You can make the variablelazy
to be able to refer to the current instance withself
or useMyClass.self
if you really want to reference the method.
Marcelo Fabri0οΈβ£ Exclude
id
fromidentifier_name
by default.
Artem Garmash #3651π Handle
get async
andget throws
(introduced in Swift 5.5) in theimplicit_getter
rule.
Marcelo Fabri #3684Speed up explicit type interface rule.
PaulTaykalo #3745Speed up analyzer rules.
PaulTaykalo #3747
π Bug Fixes
π Fix a bug with the
missing_docs
rule whereexcludes_inherited_types
would not be set.
Ben FoxFix redundant_optional_initialization autocorrect broken in case observer's brace exists. Naruki Chigira #3718
Fix a false positive in the
unneeded_break_in_switch
rule when usingdo/catch
.
Marcelo Fabri #3724Speed up Computed Accessors Order rule. PaulTaykalo #3727
[Colon Rule] Fix case when comment is used in function call. PaulTaykalo #3740
- π SwiftLint now requires Swift 5.4 or higher to build.
-
v0.44.0 Changes
π₯ Breaking
- π SwiftLint now requires Swift 5.3 or higher to build.
JP Simard
Experimental
- None.
β¨ Enhancements
β Add configuration options to
missing_docs
rule:excludes_extensions
defaults totrue
to skip reporting violations for extensions with missing documentation comments.excludes_inherited_types
defaults totrue
to skip reporting violations for inherited declarations, like subclass overrides.
Ben Fox
Fix false negative on
redundant_optional_initialization
rule when variable has observers.
Isaac Ressler #3621Make
test_case_accessibility
rule identify invalid test functions with parameters.
Keith Smiley #3612Add
duplicated_key_in_dictionary_literal
rule to warn against duplicated keys in dictionary literals.
Marcelo Fabriπ Fix the rule name from "Colon" to "Colon Spacing" to improve phrasing.
Radu #3587Add
discouraged_none_name
opt-in rule to discourage naming cases and static/class members "none", which can conflict with Swift'sOptional<T>.none
when checking equality.
Kane Cheshire #3624π Improve language and positioning of
file_length
warnings whenignore_comment_only_lines: true
.
Steven Grosmark #3654Add
anonymous_argument_in_multiline_closure
opt-in rule to validate that named arguments are used in closures that span multiple lines.
Marcelo Fabri
π Bug Fixes
Fix false positives in
empty_enum_arguments
rule when comparing values with a static member (e.g.if number == .zero
).
Marcelo Fabri #3562Fix
type_contents_order
initializer detection.
StevenMagdyπ Fix autocorrect when there's no space between the tuple the
in
keyword onunneeded_parentheses_in_closure_argument
rule.
p-x9 #3633Fix
unused_capture_list
,empty_enum_arguments
,implicit_return
andexplicit_type_interface
rules when using Swift 5.4.
Marcelo Fabri #3615 #3685π Fix Xcode build logs with spaces in paths preventing
analyze
from running.
adamawolf
- π SwiftLint now requires Swift 5.3 or higher to build.