Changelog History
Page 4
-
v0.38.0 Changes
December 03, 2019๐ฅ Breaking
- Replace the
SyntaxToken
andSyntaxMap
structures used in public SwiftLintFramework APIs with a newSwiftLintSyntaxToken
andSwiftlintSyntaxMap
wrappers over structures returned from SourceKitten.
PaulTaykalo #2955
Experimental
- None.
โจ Enhancements
๐ Make
control_statement
rule correctable.
MaxHaertwigโ Add
expiring_todo
opt-in rule to allow developers to mark their todos with an expiration date.
Dan Loman #727๐ Support compilation databases for
swiftlint analayze
.
kastiglione #2962
๐ Bug Fixes
๐ Fix false positive for LetVarWhitespaceRule.
PaulTaykalo #2956๐ Fix for false-positive identical operands rule.
PaulTaykalo #2953๐ Fixed false positive in
opening_brace
rule on anonymous closure.
Andrey Uryadov #2879
- Replace the
-
v0.37.0 Changes
November 09, 2019๐ฅ Breaking
Replace the
[String: SourceKittenRepresentable]
dictionaries used in public SwiftLintFramework APIs with a newSourceKittenDictionary
wrapper over dictionaries returned from SourceKitten.
PaulTaykalo #2922โก๏ธ Update Commandant dependency to version 0.17.0, removing the
antitypical/Result
dependency in favor of the Swift standard library'sResult
type.
JP Simard
Experimental
- None.
โจ Enhancements
๐ Speed up many operations by using SwiftLintFile wrapper over File from SourceKitten, caching most members derived from the File.
PaulTaykalo #2929๐ Speed up Swiftlint by using swift enums instead of raw values for dictionary lookups.
PaulTaykalo #2924Speed up Identical Operands rule by using syntaxmap instead of regular expressions.
PaulTaykalo #2918๐ Speed up syntax token lookups, which can improve performance when linting large files.
PaulTaykalo
#2916Use faster comparison in 'file_types_order' rule.
PaulTaykalo #2949Speed up recursively executed rules (all AST rules and some others) by avoiding the creation of many intermediate collections when accumulating results.
PaulTaykalo #2951โ Add GitHub Actions Logging reporter (
github-actions-logging
).
Norio Nomura
๐ Bug Fixes
- None.
-
v0.36.0 Changes
October 24, 2019๐ฅ Breaking
- ๐ SwiftLint now requires Swift 5.0 or higher to build.
JP Simard
Experimental
- None.
โจ Enhancements
Add
contains_over_range_nil_comparison
opt-in rule to prefer usingcontains
over comparison ofrange(of:)
tonil
.
Colton Schlosser #2776Make
contains_over_first_not_nil
rule also matchfirst(where:) == nil
.
Colton Schlosserโ Add two new cases to the Mark rule to detect a Mark using three slashes.
nvanfleet #2866Add
flatmap_over_map_reduce
opt-in rule to prefer usingflatMap
overmap { ... }.reduce([], +)
.
Marcelo Fabri #2883โ Add autocorrection to
syntactic_sugar
.
Ivan Vavilov๐ Make
toggle_bool
rule substitution correctable.
MaxHaertwigOptimize the performance of
redundant_void_return
rule.
Marcelo Fabri๐ Support building with Swift 5.1 on Linux.
Marcelo Fabri #2874Add
raw_value_for_camel_cased_codable_enum
opt-in rule to enforce raw values for camel cased Codable String enum cases.
Marko Pejovic #2888Speedup
LetVarWhiteSpacesRule
.
PaulTaykalo #2901
๐ Bug Fixes
- ๐ Fix running analyzer rules on the output of builds performed with
Xcode 11 or later.
JP Simard
- ๐ SwiftLint now requires Swift 5.0 or higher to build.
-
v0.35.0 Changes
September 03, 2019๐ This is the last release to support building with Swift 4.2.x.
๐ฅ Breaking
- None.
Experimental
- None.
โจ Enhancements
Type name rules considers SwiftUI template code.
atfelix
๐ #2791Add
no_space_in_method_call
rule to validate that there're no spaces
between the method name and parentheses in a method call.
Marcelo FabriAdd
contains_over_filter_count
opt-in rule to warn against using
expressions likefilter(where:).count > 0
instead ofcontains(where:)
.
Marcelo Fabri
๐ #2803Add
contains_over_filter_is_empty
opt-in rule to warn against using
expressions likefilter(where:).isEmpty
instead ofcontains(where:)
.
Marcelo FabriAdd
empty_collection_literal
opt-in rule to prefer usingisEmpty
to
comparison to[]
or[:]
.
Colton Schlosser
๐ #2807๐ Bug Fixes
๐ Fixed false positive in
colon
rule inside guard and ternary operator.
Andrey Uryadov
๐ #2806๐ Release memory created for sourcekitd requests.
Colton Schlosser
๐ #2812๐ Fix
swiftlint rules
output table formatting.
JP Simard
๐ #2787Don't trigger
missing_docs
violations when implementingdeinit
.
Marcelo Fabri
๐ #2690๐ Fix
unused_import
rule false positive when only operators from the module
are used.
Timofey Solonin
๐ #2737Avoid triggering
redundant_type_annotation
rule when declaring
IBInspectable
properties.
Marcelo Fabri
๐ #2842Don't trigger
missing_docs
violations on extensions.
Marcelo Fabri
๐ #2851 -
v0.34.0 Changes
July 19, 2019๐ฅ Breaking
- ๐ To enable collecting rules, many breaking changes to
SwiftLintFramework
's public API were made theLinter
type was significantely changed, and a newCollectedLinter
type was introduced. Many publicSwiftLintFramework
APIs that interacted withLinter
have also been affected. More new types and protocols were added such asRuleStorage
,AnyCollectingRule
,CollectingRule
,CollectingCorrectableRule
. We are not aware of any significant users of theSwiftLintFramework
library, so if you are affected by this, please reach out to SwiftLint contributors by filing a GitHub issue about your use case.
Elliott Williams JP Simard
Experimental
โ Add a two-stage
CollectingRule
protocol to support rules that collect data from all files before validating. Collecting rules implement acollect
method which is called once for every file, before any file is checked for violations. By collecting, rules can be written which validate across multiple files for things like unused declarations.
Elliott Williams #2431โ Add a new
unused_declaration
analyzer rule to lint for unused declarations. By default, detects unusedfileprivate
,private
andinternal
declarations. Configure the rule withinclude_public_and_open: true
to also detect unusedpublic
andopen
declarations.
JP SimardCompletely remove the
unused_private_declaration
rule. Please useunused_declaration
instead.
JP Simard
โจ Enhancements
- Added 'file_name_no_space' opt-in rule.
timcmiller #3007
๐ Bug Fixes
- None.
- ๐ To enable collecting rules, many breaking changes to
-
v0.33.1 Changes
July 08, 2019๐ฅ Breaking
- None.
Experimental
- None.
โจ Enhancements
๐ Significantly improve performance when running with a large number of cached
๐ง configurations or when running with many cached results.
๐ง This was done by splitting each configuration to have its own cache and by
encoding the cache as a binary property list instead of json.
Colton Schlosser
JP Simard๐ Several public types in SwiftLintFramework have added
Codable
conformance:
๐ Location, RuleDescription, RuleKind, StyleViolation, SwiftVersion,
ViolationSeverity.
JP Simard๐จ Print full relative path to file in log output when it matches the file name
๐ of another path being linted.
Keith Smiley๐ Bug Fixes
Don't trigger
vertical_parameter_alignment
violations when using parameters
with attributes such as@ViewBuilder
in function declarations.
Marcelo Fabri
๐ #27920๏ธโฃ Fix false positive in
function_default_parameter_at_end
rule when using
0๏ธโฃ a closure parameter with default value.
Marcelo Fabri
๐ #2788 -
v0.33.0 Changes
๐ฅ Breaking
- Remove the
weak_computed_property
rule. Please see linked issue for discussion and rationale.
JP Simard #2712
Experimental
- None.
โจ Enhancements
โ Add
" - "
delimiter to allow commenting SwiftLint commands without triggeringsuperfluous_disable_command
.
Kevin Randrupโ Make
testSimulateHomebrewTest()
test opt-in because it may fail on unknown condition. SetSWIFTLINT_FRAMEWORK_TEST_ENABLE_SIMULATE_HOMEBREW_TEST
environment variable to test like:$ SWIFTLINT_FRAMEWORK_TEST_ENABLE_SIMULATE_HOMEBREW_TEST=1 \ swift test --filter testSimulateHomebrewTest
โ Add option to configure how nested types should be separated in file names by introducting
nested_type_separator
configuration for thefile_name
rule.
Frederick Pietschmann #2717Add
unowned_variable_capture
opt-in rule to warn against unowned captures in closures when using Swift 5.
Marcelo Fabri #2097Don't trigger a
no_fallthrough_only
violation if next case is an@unknown default
.
Marcelo Fabri #2696Add
duplicate_enum_cases
rule to validate that an enum doesn't contain duplicated cases, as it's impossible to switch on it (see SR-10077 for details).
Marcelo Fabri #2676โ Add
legacy_multiple
opt-in rule to warn against using the remainder operator (%
) checking for a remainder of zero when using Swift 5.
Marcelo Fabri #2612
๐ Bug Fixes
Don't trigger
redundant_void_return
violations when usingsubscript
as the return type is required.
Marcelo FabriSkip module import if cursor info is missing module info.
alvarhansen #2746Don't trigger
file_types_order
violations in files only containing extensions.
Sam Rayner #2749๐ฎ Force-unwrapping
self
should trigger a violation of theforce_unwrapping
rule.
Dalton Claybrook #2759
- Remove the
-
v0.32.0 Changes
๐ฅ Breaking
- None.
Experimental
- None.
โจ Enhancements
โ Add
reduce_boolean
rule to prefer simpler constructs overreduce(Boolean)
.
Xavier Lowmiller #2675Add
nsobject_prefer_isequal
rule to warn against implementing==
on anNSObject
subclass as callingisEqual
(i.e. when using the class from Objective-C) will not use the defined==
method.
Matthew Healy #2663Add
reduce_into
opt-in rule to encourage the use ofreduce(into:_:)
instead ofreduce(_:_:)
which is less performant.
Dalton Claybrook #2658โ Remove @ mark to fix invalid link in Rules.md.
Hiroki Nagasawa #2669Add new opt-in rule
file_types_order
to specify how the types in a file should be sorted.
Cihat Gรผndรผz #2294Add new opt-in rule
type_contents_order
to specify the order of subtypes, properties, methods & more within a type.
Cihat Gรผndรผz #2294Add
nslocalizedstring_require_bundle
rule to ensure calls toNSLocalizedString
specify the bundle where the strings file is located.
Matthew Healy #2595contains_over_first_not_nil
rule now also checks forfirstIndex(where:)
.
Marcelo Fabri #2678Add
unused_capture_list
rule to ensure that all references in a closure capture list are used.
Dalton Claybrook #2715๐ SwiftLint can now be compiled using Xcode 10.2.
Marcelo Fabri Norio Nomura #2693
๐ Bug Fixes
๐ Fix bug where SwiftLint ignores excluded files list in a nested configuration file.
Dylan Bruschi #2447colon
rule now catches violations when declaring generic types with inheritance or protocol conformance.
Marcelo Fabri #2628discarded_notification_center_observer
rule now checks if the observer is added to any collection or passed to a function before triggering the violation.
jsloop42 #2684๐ Fix false positives on
number_separator
when the number is wrapped in parentheses.
Dalton Claybrook #2683Fix false positives on
sorted_first_last
when callingfirstIndex
andlastIndex
method. Taiki Komaba #2700๐ Fix crash when running on Linux with Swift 5 without specifying a
--path
value or specifying an empty string.
Keith Smiley #2703Fix false positives on
explicit_acl
andexplicit_top_level_acl
rules when declaring extensions that add protocol conformances with Swift 5.
Marcelo Fabri #2705Let
disable all
command overridesuperfluous_disable_command
rule.
Frederick Pietschmann #2670Fix issues in
explict_acl
,redundant_set_access_control
andexplicit_top_level_acl
rules when using Swift 5.
Marcelo Fabri #2694
-
v0.31.0 Changes
๐ฅ Breaking
- None.
Experimental
- None.
โจ Enhancements
โ Add
deployment_target
rule to validate that@availability
attributes and#available
conditions are not using a version that is satisfied by the deployment target. Since SwiftLint can't read an Xcode project, you need to configure this rule with these keys:iOS_deployment_target
,macOS_deployment_target
,watchOS_deployment_target
andtvOS_deployment_target
. By default, these values are configured with the minimum versions supported by Swift.
Marcelo Fabri #2589Add
weak_computed_property
rule to warn against usingweak
in a computed property as it has no effect.
Marcelo Fabri #2596โ Add
SwiftVersion.five
and automatically detect it when computingSwiftVersion.current
.
JP SimardMake
redundant_objc_attribute
rule autocorrectable.
Daniel Metzingโ Add
required_deinit
opt-in rule to ensure that all classes have a deinit method. The purpose of this is to make memory leak debugging easier so all classes have a place to set a breakpoint to track deallocation.
Ben Staveley-Taylor #2620nimble_operator
now warns aboutbeTrue()
andbeFalse()
.
Igor-Palaguta #2613๐ง Warn if a configured rule is not enabled.
Marcelo Fabri #1350Add
exclude_ranges
option tonumber_separator
for exclusion.
Cihat Gรผndรผz #2637
๐ Bug Fixes
Fix false positives on
no_grouping_extension
rule when usingwhere
clause.
Almaz IbragimovFix
explicit_type_interface
when used in statements.
Daniel Metzing #2154Fix
lower_acl_than_parent
when linting with Swift 5.
JP Simard #2607Fix
let_var_whitespace
with#warning
.
Igor-Palaguta #2544Fix excessive
superfluous_disable_command
violations being reported when using an invalid rule identifier in a disable command.
Marcelo Fabri #2623Fix
explicit_type_interface
withallow_redundancy
when assigning type references to variables.
Cihat Gรผndรผz #2636Fix
unused_closure_parameter
when argument is namedself
.
Cihat Gรผndรผz #2437๐ Fix
first_where
for some calls on Realm collection types.
Cihat Gรผndรผz #1930
-
v0.30.1 Changes
๐ฅ Breaking
- None.
Experimental
- Silence
CodingKeys
violations inunused_private_declaration
since these should always be intentional violations.
Kim de Vos #2573
โจ Enhancements
- โ Add
nslocalizedstring_key
opt-in rule to validate that keys used inNSLocalizedString
calls are static strings, sogenstrings
will be able to find them.
Marcelo Fabri
๐ Bug Fixes
๐ Fix false positives on
trailing_closure
rule when using anonymous closure calls.
Marcelo Fabri #2159๐ Fix false positives on
array_init
rule when using prefix operators.
Marcelo Fabri #1877๐ Exclude files defined in the
excluded
value of SwiftLint's configuration when--use-script-input-files
and--force-exclude
are specified.
Luis Valdรฉs #591