Update dependency realm/SwiftLint to v0.52.4 #57
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.44.0
->0.52.4
Release Notes
realm/SwiftLint (realm/SwiftLint)
v0.52.4
Compare Source
Breaking
Experimental
Enhancements
Handle static
spec
methods inquick_discouraged_call
rule. The methodtype changed from an instance method to a class method in Quick 7.
SimplyDanny
#5072
Prettify the rule configuration presentation on the command line as well as
on the website.
SimplyDanny
Bug Fixes
Fix false positives for the
unneeded_synthesized_initializer
rule, whenno argument initializers had side-effects.
Martin Redington
#5075
Ignore
switch
expressions assigned to variables inswitch_case_alignment
rule.
SimplyDanny
#5080
Fix auto-correction for the
direct_return
rule, when statements havetrailing comments.
Martin Redington
#5081
Fix false positives for the
private_subject
rule when creating subjectsinside initializers.
kasrababaei
Fix false positive for
prefer_self_in_static_references
when a classinherits from another class with generic types.
kasrababaei
v0.52.3
Compare Source
Breaking
Experimental
Enhancements
Make severity for unallowed symbols configurable. The option name is
unallowed_symbols_severity
. It accepts the two valueswarning
anderror
(default) as usual.
SimplyDanny
Extend
implicitly_unwrapped_optional
rule with the new modeweak_except_iboutlets
that only checksweak
variables.Ricky Tan
Mention a rule's identifier in the console message that is printed when the
rule's associated configuration entry contains invalid values.
SimplyDanny
Silence
xct_specific_matcher
rule on "one argument asserts" if there arepotential types or tuples involved in the comparison as types and tuples do
not conform to
Equatable
.SimplyDanny
#4990
Add
grouping
option to thesorted_imports
rule allowingto sort groups of imports defined by their preceding attributes
(e.g.
@testable
,@_exported
, ...).hiltonc
Add new
--silence-deprecation-warnings
flag that silences deprecationwarnings that would otherwise be printed to the console.
SimplyDanny
#4989
Do not trigger
redundant_self_in_closure
rule when another idenfierx
inscope shadows the field accessed by
self.x
to avoid semantical changes.SimplyDanny
#5010
Rewrite
todo
rule with SwiftSyntax.woxtu
Adds an
unneeded_synthesized_initializer
rule, based onswift-format
'sUseSynthesizedInitializer
rule, which warnswhen a defined default or memberwise initializer would have been
automatically synthesized.
Martin Redington
Bug Fixes
The option
validates_start_with_lowercase
can now be disabled by setting itto
off
.SimplyDanny
#5036
Do not trigger
prefer_self_in_static_references
rule ontypealias
declarations in classes.
SimplyDanny
#5009
Do not trigger
prefer_self_in_static_references
rule on collection types inclasses, but on initializers like
[C]()
in all types.SimplyDanny
#5042
Fix false positives on
redundant_objc_attribute
rule for enumsand private members.
Martin Redington
#4633
Fix autocorrect for
CGIntersectionRect
inlegacy_cggeometry_functions
rule.
Haoocen
#5023
Fix false positives on
sorted_first_last
rule whenfirst
/last
havea predicate.
woxtu
#3023
Work around dyld warning about duplicate SwiftSyntax classes with Xcode 15
betas.
keith
JP Simard
#4782
v0.52.2
Compare Source
Breaking
Experimental
Enhancements
self.x = x
from being reported bythe
redundant_self_in_closure
rule.SimplyDanny
#4988
Bug Fixes
Make
unhandled_throwing_task
opt-in instead of enabled by default. The ruleis still prone to false positives at this point, so this makes enabling the
rule a conscious decision by end-users.
JP Simard
#4987
Fix
unhandled_throwing_task
false positives when theTask
is returned orwhere the throwing code is handled in a
Result
initializer.JP Simard
#4987
v0.52.1
Compare Source
Breaking
Experimental
Enhancements
Bug Fixes
Let the
validates_start_with_lowercase
option in name configurationsexpect a severity (warning or error). Not setting it disables the check.
Boolean values are now deprecated. A
true
value enables the check as anerror for the time being to keep the previous behavior.
SimplyDanny
#2180
Fixed a false positive in
unhandled_throwing_task
.kylebshr
#4984
Fix Bazel release tarball for compiling on macOS.
JP Simard
#4985
v0.52.0
Compare Source
Breaking
The
attributes
rule now expects attributes with arguments to be placedon their own line above the declaration they are supposed to influence.
This applies to attributes with any kinds of arguments including single
key path arguments which were previously handled in a different way. This
behavior can be turned off by setting
attributes_with_arguments_always_on_line_above
to `false.
SimplyDanny
#4843
The internal module structure for SwiftLint has changed to split the
monolithic
SwiftLintFramework
into newSwiftLintCore
for core linterinfrastructure,
SwiftLintBuiltInRules
for built-in rules andSwiftLintExtraRules
to add your own native rules to SwiftLint.JP Simard
Experimental
Enhancements
Add new
superfluous_else
rule that triggers onif
-statements when anattached
else
-block can be removed, because all branches of the previousif
-block(s) would certainly exit the current scope already.SimplyDanny
Add
sorted_enum_cases
rule which warns when enum cases are not sorted.kimdv
Add new
redundant_self_in_closure
rule that triggers in closures onexplicitly used
self
when it's actually not needed due to:self
({ [self] in ... }
)self
can always be omitted){ ... }()
) as they aredefinitly not escaping
self
with explicit unwrappingSimplyDanny
#59
Extend
xct_specific_matcher
rule to check for boolean asserts on (un)equalcomparisons. The rule can be configured with the matchers that should trigger
rule violations. By default, all matchers trigger, but that can be limited to
just
one-argument-asserts
ortwo-argument-asserts
.SimplyDanny
JP Simard
#3726
Trigger
prefer_self_in_static_references
rule on more type references.SimplyDanny
Adds a new
reporters
command, to improve discoverability of reporters.Martin Redington
#4819
Adds
test_parent_classes
option to theno_magic_numbers
rule.Violations within test classes will now be ignored by default.
Martin Redington
#4896
Stop enforcing calls to super from the override functions
setUp()
,tearDown()
,setUpWithError()
, andtearDownWithError()
inXCTestCase
subclasses.
AndrewDMontgomery
#4875
Prepend
warning:
to error messages so that they show in Xcode.whiteio
#4923
The
attributes
rule received a new boolean optionattributes_with_arguments_always_on_line_above
which istrue
by default.Setting it to
false
ensures that attributes with arguments like@Persisted(primaryKey: true)
don't violate the rule if they are on the sameline with the variable declaration.
SimplyDanny
#4843
Add new
unhandled_throwing_task
rule that triggers when a Task with animplicit error type has unhandled trys or errors thrown inside its body.
This results in errors being silently discarded, which may be unexpected.
See this forum thread for more details: https://forums.swift.org/t/56066\
kylebshr
Bug Fixes
Fix
lower_acl_than_parent
rule rewriter by preserving leading whitespace.SimplyDanny
#4860
Ignore block comments in
let_var_whitespace
rule.SimplyDanny
#4871
Fix false positives in
indentation_width
rule.Sven Münnich
Do not trigger
reduce_boolean
onreduce
methods with a first namedargument that is different from
into
.SimplyDanny
#4894
Work around dyld warning about duplicate SwiftSyntax classes.
keith
#4782
Improve lint times of SwiftLintPlugin by moving the
excludedPaths(fileManager:)
operation out of the linting iterations.andyyhope
#4844
v0.51.0
Compare Source
Breaking
Deprecate the
unused_capture_list
rule in favor of the Swift compilerwarning. At the same time, make it an opt-in rule.
Cyberbeni
#4656
Deprecate the
inert_defer
rule in favor of the Swift compiler warning.At the same time, make it an opt-in rule.
SimplyDanny
#4615
Interpret strings in
excluded
option ofidentifier_name
,type_name
andgeneric_type_name
rules as regular expression. Existingconfigurations should remain working without notice as long as they don't
contain characters that must be escaped in regular expression.
Moly
#4655
Experimental
Enhancements
Add
duplicate_conditions
rule which warns when a condition is duplicatedin separate branches of the same branching statement (if-else, or switch).
1in1
#4666
Add local links to rule descriptions to every rule listed
in
Rule Directory.md
.kattouf
Make forceExclude work with directly specified files.
jimmya
#4609
Adds
all
pseudo-rule foropt_in_rules
- enables all opt in rulesthat are not listed in
disabled_rules
Martin Redington
#4540
Separate analyzer rules as an independent section in the rule directory of
the reference.
Ethan Wong
#4664
Add rule identifier to output of Emoji reporter.
SimplyDanny
#4707
Add new
direct_return
rule that triggers onreturn
statements returningvariables that have been declared in the statement before only.
SimplyDanny
Add
period_spacing
opt-in rule that checks periods are not followedby 2 or more spaces in comments.
Julioacarrettoni
#4624
Allow to pass a rule identifier to the
swiftlint docs
command to open itsspecific documentation website, e.g.
swiftlint docs for_where
.SimplyDanny
#4707
Allow new Quick APIs
aroundEach
andjustBeforeEach
forquick_discouraged_call
.David Steinacher
#4626
Add
relative-path
reporter to generate reports with relative file paths.Roya1v
#4660
Let
number_separator
rule trigger on misplaced separators, e.g.10_00
.SimplyDanny
#4637
Rewrite
multiline_arguments
rule using SwiftSyntax, ignoring trailingclosures.
Marcelo Fabri
#3399
#3605
Speed up linting by up to 6% updating to use a newer version of
SwiftSyntax
.JP Simard
Catch more valid
legacy_multiple
violations.JP Simard
Catch more valid
no_magic_numbers
violations.JP Simard
Add
blanket_disable_command
rule that checks whetherrules are re-enabled after being disabled.
Martin Redington
#4731
Add
invalid_swiftlint_command
rule that validates// swiftlint:enable
anddisable
commands.Martin Redington
#4546
Improve
identifier_name
documentation.Martin Redington
#4767
Adds
include_multiline_strings
option toindentation_width
rule.Martin Redington
#4248
Adds a new
summary
reporter, that displays the number of violationsof each rule in a text table.
Martin Redington
Bug Fixes
Report violations in all
<scope>_length
rules when the error threshold issmaller than the warning threshold.
SimplyDanny
#4645
Consider custom attributes in
attributes
rule.SimplyDanny
#4599
Fix whitespaces issue in auto-fix of
redundant_optional_initialization
rule when multiple variable declaration are involved.
SimplyDanny
#4794
Stop triggering
strict_fileprivate
rule on symbols implementing a protocolin the same file.
SimplyDanny
#4692
Fix false positives on
private_subject
rule when usingsubjects inside functions.
Marcelo Fabri
#4643
Fix for compiler directives masking subsequent
opening_brace
violations.
Martin Redington
#3712
Rewrite
explicit_type_interface
rule with SwiftSyntax fixing afalse-positive in if-case-let statements.
SimplyDanny
#4548
Stop triggering
unused_capture_list
on captured variable that is onlyreferenced by a shorthand optional binding (
if let capturedVar { ... }
).SimplyDanny
#4804
Ensure that negative literals in initializers do not trigger
no_magic_numbers
rule.SimplyDanny
#4677
Fix caching of
indentation_width
rule.SimplyDanny
#4121
Updated JUnit reporter to output error count and warning count.
patricks
#4725
Fix correction on
lower_acl_than_parent
rule foropen
declarations.Marcelo Fabri
#4753
Fix
void_return
rule to support async and async throws functions.Mathias Schreck
#4772
Fix false positives in
attributes
rule when using property wrapperswith keypath arguments.
JP Simard
Fix for
superfluous_disable_command
not being completely disabledby
disable
commands.Martin Redington
#4788
Fixed correction for
trailing_comma
rule wrongly removing trailingcomments.
Martin Redington
#4814
v0.50.3
Compare Source
Breaking
Experimental
Enhancements
The
SwiftLintPlugin
SwiftPM plugin now uses a prebuilt binary onmacOS.
Tony Arnold
JP Simard
#4558
Don't trigger
shorthand_operator
violations inside a shorthandoperator function declaration.
Marcelo Fabri
#4611
The
balanced_xctest_lifecycle
,single_test_class
,empty_xctest_method
andtest_case_accessibility
rules will now beapplied to subclasses of
QuickSpec
, as well asXCTestCase
, bydefault.
Martin Redington
Add
test_parent_classes
option tobalanced_xctest_lifecycle
,single_test_class
andempty_xctest_method
rules.Martin Redington
#4200
Show warnings in the console for Analyzer rules that are listed in the
opt_in_rules
configuration section.SimplyDanny
#4612
Bug Fixes
Fix configuration parsing error in
unused_declaration
rule.SimplyDanny
#4612
Skip
defer
statements being last in an#if
block if the#if
statement is not itself the last statement in a block.
SimplyDanny
#4615
Fix false positives in
empty_enum_arguments
when the calledexpression is an identifier or an init call.
Steffen Matthischke
#4597
Fix correction issue in
comma
when there was too much whitespacefollowing the comma.
JP Simard
v0.50.2
Compare Source
v0.50.1
Compare Source
Breaking
Experimental
Enhancements
Moved the validation of doc comments in local scopes out of
orphaned_doc_comment
and into a new opt-inlocal_doc_comment
rule.JP Simard
#4573
SwiftLint's Swift Package Build Tool Plugin will now only scan files
in the target being built.
Tony Arnold
#4406
Bug Fixes
Fix building with
swift build -c release
.JP Simard
#4559
#4560
Fix false positives in
lower_acl_than_parent
when the nominal parentis an extension.
Steffen Matthischke
#4564
Fix
minimum_fraction_length
handling innumber_separator
.JP Simard
#4576
Fix false positives in
closure_spacing
.JP Simard
#4565
#4582
Fix line count calculation for multiline string literals.
JP Simard
#4585
Fix false positives in
unused_closure_parameter
when usingidentifiers with backticks.
JP Simard
#4588
Fix
type_name
regression where names with backticks would triggerviolations.
JP Simard
#4571
v0.50.0
Compare Source
Breaking
SwiftLint now requires Swift 5.7 or higher to build.
JP Simard
Exclude
weak_delegate
rule from autocorrection due to behavioral changesleading to potential undefined behavior or bugs.
SimplyDanny
#3577
The
anyobject_protocol
rule is now deprecated and will be completely removedin a future release because it is now handled by the Swift compiler.
JP Simard
Built-in SwiftLint rules are no longer marked as
public
inSwiftLintFramework. This only impacts the programmatic API for the
SwiftLintFramework module.
JP Simard
Experimental
Enhancements
SwiftSyntax libraries have been updated from the previous 5.6 release and now
use the new parser written in Swift.
Swift 5.7+ features should now be parsed more accurately.
We've also measured an improvement in lint times of up to 15%.
This should also fix some deployment issues where the exact version of the
internal SwiftSyntax parser needed to be available.
If you notice any unexpected changes to lint results, please file an issue on
the SwiftLint issue tracker. We can look into it and if it's a SwiftSyntax
parser regression we can re-file it upstream.
JP Simard
#4031
Rewrite some rules with SwiftSyntax, fixing some false positives and catching
more violations:
anonymous_argument_in_multiline_closure
array_init
attributes
balanced_xctest_lifecycle
block_based_kvo
class_delegate_protocol
closing_brace
closure_body_length
closure_parameter_position
collection_alignment
comment_spacing
computed_accessors_order
conditional_returns_on_newline
contains_over_filter_count
contains_over_filter_is_empty
contains_over_first_not_nil
contains_over_range_nil_comparison
convenience_type
deployment_target
discarded_notification_center_observer
discouraged_assert
discouraged_direct_init
discouraged_none_name
discouraged_object_literal
discouraged_optional_boolean
duplicate_enum_cases
duplicated_key_in_dictionary_literal
dynamic_inline
empty_collection_literal
empty_count
empty_enum_arguments
empty_parameters
empty_parentheses_with_trailing_closure
empty_string
enum_case_associated_values_count
explicit_enum_raw_value
explicit_init
explicit_top_level_acl
fallthrough
file_name
first_where
flatmap_over_map_reduce
for_where
force_try
force_unwrapping
function_body_length
function_default_parameter_at_end
function_parameter_count
generic_type_name
ibinspectable_in_extension
identical_operands
implicit_getter
implicitly_unwrapped_optional
inclusive_language
inert_defer
is_disjoint
joined_default_parameter
large_tuple
last_where
legacy_cggeometry_functions
legacy_constant
legacy_constructor
legacy_hashing
legacy_multiple
legacy_nsgeometry_functions
legacy_objc_type
legacy_random
lower_acl_than_parent
multiline_arguments_brackets
multiline_parameters
multiple_closures_with_trailing_closure
no_extension_access_modifier
no_fallthrough_only
no_space_in_method_call
notification_center_detachment
nslocalizedstring_key
nslocalizedstring_require_bundle
nsobject_prefer_isequal
number_separator
object_literal
operator_whitespace
optional_enum_case_matching
orphaned_doc_comment
overridden_super_call
override_in_extension
pattern_matching_keywords
prefer_nimble
prefer_self_in_static_references
prefer_self_type_over_type_of_self
prefer_zero_over_explicit_init
prefixed_toplevel_constant
private_action
private_outlet
private_over_fileprivate
private_subject
private_unit_test
prohibited_interface_builder
prohibited_super_call
protocol_property_accessors_order
quick_discouraged_focused_test
quick_discouraged_pending_test
raw_value_for_camel_cased_codable_enum
reduce_boolean
reduce_into
redundant_discardable_let
redundant_nil_coalescing
redundant_objc_attribute
redundant_optional_initialization
redundant_set_access_control
redundant_string_enum_value
required_deinit
required_enum_case
return_arrow_whitespace
self_in_property_initialization
shorthand_operator
single_test_class
sorted_first_last
static_operator
strict_fileprivate
strong_iboutlet
switch_case_alignment
switch_case_on_newline
test_case_accessibility
toggle_bool
trailing_comma
trailing_semicolon
type_body_length
type_name
unneeded_break_in_switch
unneeded_parentheses_in_closure_argument
unowned_variable_capture
untyped_error_in_catch
unused_capture_list
unused_closure_parameter
unused_control_flow_label
unused_enumerated
unused_optional_binding
unused_setter_value
valid_ibinspectable
vertical_parameter_alignment
weak_delegate
xct_specific_matcher
xctfail_message
Marcelo Fabri
SimplyDanny
JP Simard
#2915
The "body length" family of rules have changed how they calculate body
line count to be significantly more correct and intuitive. However,
this is likely to require adjustments to your configuration or disable
commands to account for the changes.
JP Simard
Add ability to filter rules for
generate-docs
subcommand.kattouf
Add new
excludes_trivial_init
configuration formissing_docs
ruleto exclude initializers without any parameters.
Marcelo Fabri
#4107
Add new
ns_number_init_as_function_reference
rule to catchNSNumber.init
and
NSDecimalNumber.init
being used as function references since itcan cause the wrong initializer to be used, causing crashes. https://github.com/apple/swift/issues/51036es/51036 for more info.
Marcelo Fabri
Add
accessibility_trait_for_button
rule to warn if a SwiftUIView has a tap gesture added to it without having the button or
link accessibility trait.
Ryan Cole
Add methods from SE-0348 to
UnusedDeclarationRule
.JP Simard
Include the configured
bind_identifier
inself_binding
violationmessages.
JP Simard
The
self_binding
rule now catches shorthand optional bindings (for exampleif let self {}
) when using abind_identifier
different thanself
.Marcelo Fabri
Add
library_content_provider
file type tofile_types_order
ruleto allow
LibraryContentProvider
to be ordered independent frommain_type
.dahlborn
Add
test_parent_classes
option totest_case_accessibility
rule, whichallows detection in subclasses of XCTestCase.
Martin Redington
#4200
Add a new
shorthand_optional_binding
opt-in rule that triggers in Swift 5.7when a shadowing optional binding is created in an
if
orguard
statement.SimplyDanny
#4202
Use SwiftSyntax instead of SourceKit to determine if a file has parser errors
before applying corrections. This speeds up corrections significantly when
none of the rules use SourceKit.
JP Simard
Add Swift Package Build Tool Plugin with support for Swift Packages
and Xcode projects.
Johannes Ebeling
#3679
#3840
Make
private_unit_test
rule correctable.SimplyDanny
Disregard whitespace differences in
identical_operands
rule. That is, the rulenow also triggers if the left-hand side and the right-hand side of an operation
only differ in trivia.
SimplyDanny
Print violations in realtime if
--progress
and--output
are both set.JP Simard
Trigger
prefer_self_in_static_references
rule on more type references like:\MyType.myVar
->\Self.myVar
)var i: Int { MyType.myVar )
->var i: Int { Self.myVar }
)MyType()
->Self()
)SimplyDanny
Update
for_where
rule, adding a new configurationallow_for_as_filter
to allow usingfor in
with a singleif
insidewhen there's a
return
statement inside theif
's body.Marcelo Fabri
#4040
quick_discouraged_call
,quick_discouraged_focused_test
andquick_discouraged_pending_test
rules now trigger on subclasses ofQuickSpec
.Marcelo Fabri
#4420
The
type_name
rule now validates protocol declarations by default.You can opt-out by using the
validate_protocols
key in your configuration:Marcelo Fabri
#4430
Report how much memory was used when
--benchmark
is specified.JP Simard
Adds
NSError
to the list of types indiscouraged_direct_init
.jszumski
#4508
Fix SwiftLint support on Xcode Cloud.
JagCesar
westerlund
#4484
Add
no_magic_numbers
rule to avoid "Magic Numbers".Henrik Storch
#4031
Add new option
only_enforce_before_trivial_lines
tovertical_whitespace_closing_braces
rule. It restrictsthe rule to apply only before trivial lines (containing
only closing braces, brackets and parentheses). This
allows empty lines before non-trivial lines of code
(e.g. if-else-statements).
benjamin-kramer
#3940
Bug Fixes
Respect
validates_start_with_lowercase
option when linting function names.Chris Brakebill
#2708
Do not report variables annotated with
@NSApplicationDelegateAdaptor
and@WKExtensionDelegateAdaptor
inweak_delegate
rule.Till Hainbach
#3598
#3611
Fix false-positives related to the
willMove
lifecycle method intype_contents_order
rule.SimplyDanny
#3478
Do no longer autocorrect usage of
NSIntersectionRect
inlegacy_nsgeometry_functions
rule.
SimplyDanny
#3703
Fix Analyzer rules in Xcode 14.
SimplyDanny
#4208
Add column for SourceKit usage to
rules
command.JP Simard
Make
nsobject_prefer_isequal
rule work for nested@objc
classes. Also considerthe
@objcMembers
annotation.SimplyDanny
Print fixed content at most once to STDOUT.
SimplyDanny
#4211
Fix fatal error when content given via STDIN is corrected in the
trailing_newline
rule.SimplyDanny
#4234
Fix false-positives from
multiline_arguments_brackets
when a function call has asingle line trailing closure.
CraigSiemens
#4510
v0.49.1
Compare Source
Note: The default branch for the SwiftLint git repository was renamed from
master
tomain
on September 1st. Please update any code or automationaccordingly.
Breaking
Experimental
Enhancements
Add new
self_binding
opt-in rule to enforce thatself
identifiers areconsistently re-bound to a common identifier name. Configure
bind_identifier
to the name you want to use. Defaults to
self
.JP Simard
#2495
Add
--output
option to lint and analyze commands to write to a file insteadof to stdout.
JP Simard
#4048
Add
--progress
flag to lint and analyze commands to show a live-updatingprogress bar instead of each file being processed.
JP Simard
--fix
now works with--use-stdin
, printing the output to to STDOUT insteadof crashing.
SimplyDanny
#4127
Bug Fixes
Migrate
empty_xctest_method
rule to SwiftSyntax fixing some false positives.SimplyDanny
#3647
#3691
Fix false positives in
redundant_discardable_let
when usingasync let
.Martin Hosna
#4142
Consistently print error/info messages to stderr instead of stdout,
which wasn't being done for errors regarding remote configurations.
JP Simard
v0.49.0
Compare Source
Note: The default branch for the SwiftLint git repository will be renamed from
master
tomain
on September 1st. Please update any code or automationaccordingly.
Breaking
SwiftLint now requires Swift 5.6 or higher to build, and macOS 12
or higher to run.
JP Simard
Code Climate reports now use SHA256 strings as the issue fingerprint
values.
JP Simard
Make
comma_inheritance
an opt-in rule.Steve Madsen
#4027
The
autocorrect
command that was deprecated in 0.43.0 has now beencompletely removed. Use
--fix
instead.JP Simard
Remove the
AutomaticTestableRule
protocol. All examples listed in rules arenow tested automatically to make sure they are correct.
SimplyDanny
Deprecate the
--in-process-sourcekit
command line flag. SwiftLint now alwaysuses an in-process SourceKit.
JP Simard
Experimental
Enhancements
Make
duplicate_imports
rule correctable. Fixduplicate_imports
rulereporting redundant violations when more than one duplicate is present.
Timofey Solonin
Support for building SwiftLint with bazel.
JP Simard
Support for writing custom private native rules when building with
bazel.
JP Simard
Keith Smiley
#3516
Make
comma
rule about 10x faster, finding some previously missed cases andfixing some previously wrong corrections.
JP Simard
Make
colon
rule about 7x faster, finding some previously missed cases.JP Simard
Make
closure_spacing
rule about 9x faster, finding some previously missedcases and fixing some previously wrong corrections.
JP Simard
SimplyDanny
#4090
Introduce new configuration option
include_compiler_directives
(true
bydefault) for the
indentation_width
rule that allows to ignore compilerdirectives in the indentation analysis. This is especially useful if one (or
a formatter) prefers to have compiler directives always at the very beginning
of a line.
SimplyDanny
#4030
Enable (recursive) globs in
included
file paths.sarastro-nl
Custom rules are now broken down per rule instead of in aggregate in
--benchmark
.JP Simard
The
version
command now has an optional--verbose
flag that prints out thefull version info, notably the build ID, which can be used to determine if two
swiftlint
executables are identical.JP Simard
Update documentation for
multiline_arguments_brackets
andmultiline_literal_brackets
to make it immediately obvious that commonexamples will trigger.
chrisjf
#4060
The
--compile-commands
argument can now parse SwiftPM yaml files producedwhen running
swift build
at.build/{debug,release}.yaml
.JP Simard
Add new configuration option
allowed_no_space_operators
tooperator_usage_whitespace
rule. It allows to specify custom operators whichshall not be considered by the rule.
imben123
Add new protocols to remove some boilerplate involved in writing
SwiftSyntax-based rules.
JP Simard
Bug Fixes
Fix false positive in
self_in_property_initialization
rule when usingclosures inside
didSet
and other accessors.Marcelo Fabri
#4041
Fix false positive in
Duplicated Key in Dictionary Literal Violation
rulewhen using keys that are generated at runtime with the same source code.
OrEliyahu
#4012
Fix false positive in
yoda_condition
rule by basing it on SwiftSyntax.SimplyDanny
#4081
Fix false negatives in
first_where
rule when filtering array of dictionarieswith String keys.
KS1019
Fix broken correction for
explicit_init
rule.KS1019
v0.48.0
Compare Source
This is the last release to support building with Swift 5.5.x and running on
macOS < 12.
Breaking
--path
options forlint
/analyze
commands. Prefer thepositional paths that can be added last to both commands.
SimplyDanny
Experimental
Enhancements
Support
iOSApplicationExtension
,macOSApplicationExtension
,watchOSApplicationExtension
, andtvOSApplicationExtension
identifiersin the
deployment_target
rule. To configure the rule for these identifiers,you need to use the keys
iOSApplicationExtension_deployment_target
,macOSApplicationExtension_deployment_target
,watchOSApplicationExtension_deployment_target
, andtvOSApplicationExtension_deployment_target
. Extentions default totheir counterparts unless they are explicitly defined.
tahabebek
#4004
Rewrite
operator_usage_whitespace
rule using SwiftSyntax, fixingfalse positives and false negatives.
Note that this rule doesn't catch violations around return arrows (
->
)anymore - they are already handled by
return_arrow_whitespace
.Marcelo Fabri
#3965
#3668
#2728
Support arrays for the
included
andexcluded
options when defininga custom rule.
Marcelo Fabri
Add back
void_function_in_ternary
opt-in rule to warn against usinga ternary operator to call
Void
functions.Marcelo Fabri
Support
UIEdgeInsets
type inprefer_zero_over_explicit_init
rule.KokiHirokawa
#3986
Bug Fixes
Ignore array types in
syntactic_sugar
rule if their associatedIndex
isaccessed.
SimplyDanny
#3502
Prevent crash for private types named
_
intype_name
rules.sinoru
#3971
Make
for_where
rule implementation independent of order in structuredictionary. This fixes the rule in Xcode 13.3 where some violation were
no longer reported.
SimplyDanny
#3975
Update result builder methods in
unused_declaration
rule fixing somefalse-positives.
SimplyDanny
Look for call expressions which are not wrapped into an argument when
checking for nested (possibly multiline) arguments fixing some
false-negatives in (at least) Xcode 13.2.
SimplyDanny
#3975
Make sure that include paths prefixed with the name of the original path
are included in the analysis.
SimplyDanny
#3705
Do not trigger
unavailable_condition
rule if other#(un)available
checks are involved.
SimplyDanny
#3985
Update
nimble_operator
to support the operators forbeNil()
.CraigSiemens
Avoid false-positive in
let_var_whitespace
rule by allowing customattributes on lines directly before let/var declarations.
SimplyDanny
#2980
v0.47.1
Compare Source
Breaking
Experimental
Enhancements
Add type-checked analyzer rule version of
ArrayInitRule
namedTypesafeArrayInitRule
with identifiertypesafe_array_init
thatavoids 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 the
IN_PROCESS_SOURCEKIT
environment variable.
Juozas Valancius
Add a new
artifactbundle
release asset containingswiftlint
binaries forx86 & arm64 macOS.
Juozas Valancius
#3840
Add 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
#3343
Add
accessibility_label_for_image
rule to warn if a SwiftUIImage 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 usingSwift 5.6 or later.
Marcelo Fabri
#3897
Add
comma_inheritance
rule to validate that inheritance clauses use commasinstead of
&
.Marcelo Fabri
#3950
Bug Fixes
Fix false positives in
unused_closure_parameter
when using parameters withbackticks.
JP Simard
#3628
Improved the
syntactic_sugar
rule's detection accuracy and fixed somecorrections 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
#3920
Error by default on bad expiring todo date formatting.
Christopher Hale
#3636
Lint/analyze all files listed in the command even if the
--path
option isused.
coffmark
v0.47.0
Compare Source
Breaking
SwiftLint now requires Swift 5.5 or higher to build.
JP Simard
The
SwiftLintFramework
podspec has been removed. To our knowledge, this wascompletely unused by other projects and was not worth the complexity needed
to justify its continued maintenance, especially in light of the integration
of SwiftSyntax. The
SwiftLint
podspec is still supported.JP Simard
SwiftLint now requires at least Swift 5.0 installed in order to lint files.
Marcelo Fabri
Experimental
force_cast
rule and the comment command parsing mechanism have beenupdated 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
#3854
Support recursive globs.
funzin
JP Simard
#3789
#3891
The
legacy_random
rule is now enabled by default.Marcelo Fabri
The
deployment_target
rule now supports the#unavailable
syntaxadded in Swift 5.6.
Marcelo Fabri
#3896
Set the
IN_PROCESS_SOURCEKIT
environment variable, which will usethe 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) exa
Configuration
📅 Schedule: Branch creation - "after 7pm every weekday,before 8am every weekday,every weekend" in timezone Asia/Tokyo, Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.