Changelog History
Page 3
-
v0.41.0 Changes
November 08, 2020π₯ Breaking
π Changed behavior of
strict
option onlint
andanalyze
to treat
β all warnings as errors instead of only changing the exit code.
Jeehut
π #3312Removed 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 ClaybrookExperimental
- None.
β¨ Enhancements
β Add
use-alternative-excluding
option to speed up linting in cases
π described in #3325.
This option yields different exclusion behavior.
JohnReeze
π #3304Add
test_case_accessibility
rule.
Keith Smiley
π #3376β Add more details to
CONTRIBUTING.md
.
mknabbe
π #1280β Remove
@IBOutlet
and@IBInspectable
from UnusedDeclarationRule.
Keith Smiley
π #3184Add
allow_multiline_func
configuration option toopening_brace
rule, to allow placing{
on new line in case of multiline function.
0οΈβ£ 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
π #3293unused_closure_parameter
rule now validates closures outside of
function calls.
Marcelo Fabri
π #1082π Improve documentation for running SwiftLint as Xcode build phase.
Christian Mitteldorf
π #3169Add
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ΓΌnnichFix incorrect autocorrection in
prefer_zero_over_explicit_init
rule.
Paul TaykaloRule
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
π #3333Fix 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 -
v0.40.3 Changes
September 22, 2020π₯ 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
π #2367Rule
multiple_closures_with_trailing_closure
no longer triggers when Swift
5.3's 'multiple trailing closures' feature is used.
Jumhyn
π #3295 -
v0.40.2 Changes
September 11, 2020π₯ Breaking
- None.
Experimental
- None.
β¨ Enhancements
Improve description for
empty_enum_arguments
.
π¨ Lukas SchmidtAdd support for
excluded_match_kinds
custom rule config parameter.
Ryan Demoπ Bug Fixes
- None.
-
v0.40.0 Changes
August 10, 2020π₯ Breaking
π SwiftLint now requires Swift 5.1 or higher to build.
JP Simardπ Improve compile commands json file validation. If you previously provided invalid files or arguments, the command will now abort.
Keith Smiley
Experimental
- None.
β¨ Enhancements
π JUnit reporter for GitLab artifact:report:junit with better representation of found issues.
krin-san #3177Add opt-in
ibinspectable_in_extension
rule to lint against@IBInspectable
properties inextensions
.
Keith SmileyAdd
computed_accessors_order
rule to validate the order ofget
andset
accessors in computed properties and subscripts.
Marcelo Fabri #3158Extend
empty_enum_arguments
rule to supportif case
andguard case
.
Zsolt KovΓ‘cs #3103Add
prefer_zero_over_explicit_init
opt-in rule to enforce using.zero
instead of calling constructor with zero arguments (e.g.CGPoint(x: 0, y: 0)
) when using CoreGraphics types.
Anton Nazarov #3190β Add
swiftlint docs
command to easily open online documentation.
417-72KIAdd
unneeded_notification_center_removal
rule to warn against usingNotificationCenter.removeObserver(self)
indeinit
since it's not required after iOS 9/macOS 10.11.
Amzed #2755
π Bug Fixes
π Fix UnusedImportRule breaking transitive imports.
keithπ Fix severity level configuration for
duplicate_imports
.
Yusuke GotoFixes false positives for
multiline_parameters_brackets
andmultiline_arguments_brackets
.
Noah Gilmore #3167Fix conflict of 'opening_brace' with 'implicit_return' for functions implicitly returning a closure.
SimplyDanny #3034Fix false positive on
switch_case_on_newline
rule withdo/catch
statements when using Swift 5.3.
Marcelo Fabri #3253π Fix false positive uppercase enum case in
raw_value_for_camel_cased_codable_enum
rule.
TeamehFix false positive in
no_space_in_method_call
rule with multiple trailing closures (Swift 5.3).
Marcelo Fabri #3259π Fix false negative in
explicit_acl
rule when usingextension
with Swift 5.2+.
Marcelo Fabri #3186closure_parameter_position
now triggers in closures that are not inside a function call and also validates captured variables.
Marcelo Fabri #3225π Fix some cases where the output would be incomplete when running SwiftLint on Linux.
Marcelo Fabri #3214compiler_protocol_init
now triggers onIndexSet(arrayLiteral:)
.
Janak Shah #3284Fix false positives in
extension_access_modifier
rule when using Swift 5.2.
Marcelo Fabri #3150
-
v0.39.2 Changes
April 04, 2020π This is the last release to support building with Swift 5.0.x.
π₯ Breaking
- None.
Experimental
- None.
β¨ Enhancements
- β Add configuration options to the
unused_import
rule to require
explicit import statements for each module referenced in a source
file (require_explicit_imports
). When this setting is enabled,
anallowed_transitive_imports
setting may also be specified to allow
π a mapping of modules to transitively imported modules. See PR for
π details: #3123
JP Simard
π #3116
π Bug Fixes
π Fix more false positives in
implicit_getter
rule in extensions when using
Swift 5.2.
Marcelo Fabri
π #3149Fix false positives in
redundant_objc_attribute
rule in extensions when
using Swift 5.2.
Marcelo Fabriπ Fix false positives in
attributes
rule when usingrethrows
using
Swift 5.2.
JP Simardπ Fix false positives in
valid_ibinspectable
rule when defining inspectable
properties in class extensions with computed properties using Swift 5.2.
JP Simard -
v0.39.1 Changes
February 11, 2020π₯ Breaking
- The new rules introduced in 0.39.0 that depend on SwiftSyntax have been temporarily removed as we work out release packaging issues.
Experimental
- None.
β¨ Enhancements
- None.
π Bug Fixes
- π Fix unused_import rule reported locations and corrections when
multiple
@testable
imports are involved.
JP Simard
-
v0.39.0 Changes
February 11, 2020π₯ Breaking
Replace all uses of
Int
/Int64
/NSRange
representing byte offsets to use newly introducedByteCount
andByteRange
values instead. This will minimize the risk of accidentally using a byte-based offset in character-based contexts.
Paul Taykalo JP Simardπ SwiftLint now imports SwiftSyntax and requires Xcode 11.0 to build.
Marcelo Fabri
Experimental
- None.
β¨ Enhancements
β Add option to pass successfully if no files passed to SwiftLint are lintable.
thedavidharris #2608iAdd
deinitializer
type content totype_contents_order
rule instead of grouping it with initializers.
Steven Magdyπ Inline test failure messages to make development of SwiftLint easier. Test failures in triggering and non-triggering examples will appear inline in their respective files so you can immediately see which cases are working and which are not.
ZevEisenberg #3040Introduce a new
SyntaxRule
that enables writing rules using SwiftSyntax.
Marcelo Fabriβ Add
tuple_pattern
opt-in rule to warn against using assigning variables through a tuple pattern when the left side of the assignment contains labels.
Marcelo Fabri #2203Add
return_value_from_void_function
opt-in rule to warn against usingreturn <expression>
in a function that isVoid
.
Marcelo FabriAdd
void_function_in_ternary
opt-in rule to warn against using a ternary operator to callVoid
functions.
Marcelo Fabri #2358Add
only_after_dot
configuration option toempty_count
rule. With the option enabled,empty_count
rule will ignore variables namedcount
. By default, this option is disabled.
Zsolt KovΓ‘cs #827Add
prohibited_nan_comparison
opt-in rule to validate usingisNaN
instead of comparing values to the.nan
constant.
Marcelo Fabri #2086Add case
preview_provider
to the order list offile_types_order
to fix an issue with false positives forPreviewProvider
subclasses in SwiftUI.
Cihat GΓΌndΓΌz #2860
π Bug Fixes
π Fix false positive in
attributes
rule with@autoclosure
parameters when using Swift 5.2.
Mateusz Matrejek #3079Fix
discarded_notification_center_observer
false positives when capturing observers into an array.
Petteri Huuskoπ Fix crash when non-closed #if was present in file.
PaulTaykaloπ Fix false positives when line ends with carriage return + line feed.
John Mueller #3060Implicit_return description now reports current config correctly. John Buckley
π Fix false positive in
implicit_getter
rule in extensions when using Swift 5.2.
Marcelo Fabri #3074Do not trigger
optional_enum_case_matching
rule on_?
as the?
might be required in some situations.
Marcelo Fabri #3057π Fix false positive in
attributes
rule with@escaping
parameters when using Swift 5.2.
Marcelo Fabri #3079π Fix false positive in
empty_string
rule when using multiline string literals.
Marcelo Fabri #3100
-
v0.38.2 Changes
January 08, 2020π₯ Breaking
- None.
Experimental
- None.
β¨ Enhancements
β Add option to configure which kinds of expressions should omit their
return
keyword by introducing anincluded
configuration for theimplicit_return
rule. Supported values areclosure
,function
andgetter
. Defaults to all three.
Sven MΓΌnnich #2870β Add
--correctable
and--verbose
arguments to therules
command to allow displaying only correctable rules, and to always print the full configuration details regardless of your terminal width.
Optional EndeavorsAdd
capture_group
option tocustom_rules
for more fine-grained placement of the location marker for violating code.
pyrtsaAdd
orphaned_doc_comment
rule to catch doc comments that are not attached to any declarations.
Marcelo Fabri #2989β Add new indentation opt-in rule (
indentation_width
) checking for super-basic additive indentation pattern.
Frederick Pietschmann #227Catch previously missed violations in the
optional_enum_case_matching
rule when case expressions involved tuples.
JP Simardπ API docs for SwiftLintFramework are now available at realm.github.io/SwiftLint.
Rules.md
now redirects to the rules directory in the API docs here. Contributors no longer need to update rule documentation in PRs as this is now done automatically. The rule documentation now includes the default configuration.
JP Simard #1653 #1704 #2808 #2933 #2961
π Bug Fixes
- π Fix issues in
unused_import
rule when correcting violations in files containing@testable
imports where more than the unused imports would be removed.
JP Simard
-
v0.38.1 Changes
January 04, 2020π₯ Breaking
- None.
Experimental
- None.
β¨ Enhancements
π Make
weak_delegate
rule correctable.
MaxHaertwigπ Allow
SubstitutionCorrectableRule
to returnnil
instead of a correction
to indicate that a suitable correction couldn't be found for a specific case.
MaxHaertwigAdd
enum_case_associated_value_count
opt-in rule.
lakpa
π #2997Add
optional_enum_case_matching
opt-in rule to validate that
optional enum cases are matched without using?
when using Swift 5.1 or
π above. See SR-7799 for more
details.
Marcelo FabriAdd
prefer_self_type_over_type_of_self
opt-in rule to enforce using
Self
instead oftype(of: self)
when using Swift 5.1 or above.
Marcelo Fabri
π #3003π Bug Fixes
π Fix crash in
unused_import
rule when unused imports have trailing
comments.
JP Simard
π #2990Handle
@_exported
imports inunused_import
rule.
JP Simard
π #2877π Fix false positives from the
unused_declaration
rule involving
functions in protocol extensions.
JP Simardπ Fix parsing of SwiftLint commands containing a URL in their trailing comment.
Sven MΓΌnnichβ Added missing parameters to
FileNameConfiguration.consoleDescription
.
timcmiller
π #3009π Fix crash when SourceKit returns out of bounds string byte offsets.
JP Simard