Releases: realm/SwiftLint
0.31.0: Busy Laundromat
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
and
tvOS_deployment_target
. By default, these values are configured with the
minimum versions supported by Swift.
Marcelo Fabri
#2589 -
Add
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 computing
SwiftVersion.current
.
JP Simard -
Make
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
#2620 -
nimble_operator
now warns aboutbeTrue()
andbeFalse()
.
Igor-Palaguta
#2613 -
Warn if a configured rule is not enabled.
Marcelo Fabri
#1350 -
Add
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 Ibragimov -
Fix
explicit_type_interface
when used in statements.
Daniel Metzing
#2154 -
Fix
lower_acl_than_parent
when linting with Swift 5.
JP Simard
#2607 -
Fix
let_var_whitespace
with#warning
.
Igor-Palaguta
#2544 -
Fix excessive
superfluous_disable_command
violations being reported when
using an invalid rule identifier in a disable command.
Marcelo Fabri
#2623 -
Fix
explicit_type_interface
withallow_redundancy
when assigning type
references to variables.
Cihat Gündüz
#2636 -
Fix
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
0.30.1: Localized Stain Remover
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 in
NSLocalizedString
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
0.30.0: A New Washer and Dryer Set
Breaking
- None.
Experimental
- None.
Enhancements
-
Add
duplicate_imports
rule to prevent importing the same module twice.
Samuel Susla
#1881 -
Add
unused_setter_value
rule to validate that setter arguments are
used in properties.
Marcelo Fabri
#1136 -
Add
only_single_muted_parameter
configuration ontrailing_closure
rule
to only enforce using trailing closure on functions that take one single
muted parameter.
Marcelo Fabri
Bug Fixes
0.29.4: In-Unit Operands
Breaking
- None.
Experimental
- Fix
unused_import
correction deleting unrelated ranges when there are
multiple violations in a single file.
JP Simard
#2561
Enhancements
- Add
strong_iboutlet
opt-in rule to enforce that@IBOutlet
s are not
declared asweak
.
Marcelo Fabri
#2433
Bug Fixes
-
Fix inaccessible custom rules in nested configurations.
Timofey Solonin
#1815
#2441 -
Improve
superfluous_disable_command
to warn against disabling non-existent
rules.
Kim de Vos
#2348 -
Fix false positives on
identical_operands
rule when the right side of the
operand does not terminate.
Xavier Lowmiller
#2467
0.29.3: Entangled Agitator
Breaking
- None.
Experimental
- Skip
@IBInspectable
anddeinit
declarations in
unused_private_declaration
.
JP Simard
Enhancements
-
Allow configuring
discouraged_object_literal
rule to only discourage one
kind of object literal.
Marcelo Fabri
#2439 -
Adds
xct_specific_matcher
opt-in rule to enforce specific matchers
overXCTAssertEqual
andXCTAssertNotEqual
.
Ornithologist Coder
#1874 -
Add
last_where
opt-in rule that warns against using
.filter { /* ... */ }.last
in collections, as
.last(where: { /* ... */ })
is more efficient.
Marcelo Fabri -
Add
unused_control_flow_label
rule to validate that control flow labels are
used.
Marcelo Fabri
#2227
Bug Fixes
-
Fix false positives on
first_where
rule when callingfilter
without a
closure parameter (for example on a Realm collection).
Marcelo Fabri -
Fix false positives on
sorted_first_last
rule when callingsorted
with
a different argument thanby:
(e.g. on a Realm collection).
Marcelo Fabri
#2533 -
Fix false positives on
redundant_objc_attribute
rule when using nested
types.
Marcelo Fabri
#2539 -
Fix false positives on
vertical_whitespace_between_cases
rule when a blank
line is present but it contains trailing whitespace.
Ben Staveley-Taylor
#2538
0.29.2: Washateria
Breaking
- None.
Experimental
- None.
Enhancements
-
Add new opt-in rule
vertical_whitespace_opening_braces
to warn against empty
lines after opening braces.
Cihat Gündüz
#1518 -
Add new opt-in rule
vertical_whitespace_closing_braces
to warn against empty
lines before closing braces.
Cihat Gündüz
#1518 -
Improve performance for
unused_private_declaration
andunused_import
rules
for large files.
Niil Öhlin -
Add new
legacy_hashing
rule to encourage the use of Swift 4.2's new hashing
interface.
Kim de Vos
#2108 -
Improve
private_unit_test
rule to allow private classes with@objc
attribute.
Kim de Vos
#2282 -
Support glob patterns without the star.
Maksym Grebenets -
Make
modifier_order
rule autocorrectable.
Timofey Solonin
#2353
Bug Fixes
-
Fix false positives in
redundant_objc_attribute
for private declarations
under@objcMembers
.
Daniel Metzing
#2499 -
Fix an error when pulling SwiftLint as a dependency using Carthage.
JP Simard -
Non-string values specified in
swiftlint_version
now fail the lint if
it doesn't match the version.
JP Simard
#2518
0.29.1: There’s Always More Laundry
Breaking
- None.
Experimental
- None.
Enhancements
-
Add
redundant_objc_attribute
to warn against already implied@objc
attribute.
Daniel Metzing
#2193 -
Add
vertical_whitespace_between_cases
opt-in rule to enforce a single
empty line between switch cases.
Cihat Gündüz
#1517 -
Add
multiline_arguments_brackets
opt-in rule to warn against multiline
function call arguments with surrounding brackets without newline.
Cihat Gündüz
#2306 -
Add
multiline_literal_brackets
opt-in rule to warn against multiline
literal arrays & dictionaries with surrounding brackets without newline.
Cihat Gündüz
#2306 -
Add
multiline_parameters_brackets
opt-in rule to warn against multiline
function definition parameters with surrounding brackets without newline.
Cihat Gündüz
#2306 -
Ignore unspecified modifiers in
modifier_order
.
Timofey Solonin
#2435 -
The
lint
command now exits with a code of 2 when not using pinned
version defined asswiftlint_version
in the configuration file.
Kim de Vos
#2074
Bug Fixes
-
Fix false positive in
nimble_operator
rule.
Marcelo Fabri
#2489 -
Fix false positives on
explicit_type_interface
rule when
configured with optionallowRedundancy
set totrue
.
Cihat Gündüz
#2425 -
Only mark custom rules as 'enabled in your config' in the output of the
rules
command when there are one or more configured custom rules.
jhildensperger -
Fix wrong correction when removing testable imports with the
unused_import
rule.
JP Simard -
Fix false positive with the
unused_import
rule when importing Foundation
when there are attributes in that file requiring Foundation.
JP Simard
0.29.0: A Laundry List of Changes
Breaking
- SwiftLint now requires Swift 4.2 or higher to build.
JP Simard
Experimental
- None.
Enhancements
-
Improve the performance of saving or reading cached lint results on platforms
with CommonCrypto.
JP Simard -
Add
markdown
reporter which outputs markdown-formatted tables, ideal for
rendering in GitLab or GitHub.
Dani Vela -
Add
testSimulateHomebrewTest()
toIntegrationTests
that simulates test in
homebrew-core/Formula/swiftlint.rb
within sandbox.
Norio Nomura
Bug Fixes
-
Fix compiler warnings when building with Swift 4.2 introduced in the last
release.
JP Simard -
Fix false positive in
explicit_init
rule.
Dominic Freeston -
Fix
toggle_bool
false positive violation when comparing object parameter to
an equally named variable.
Timofey Solonin
#2471 -
Fix false positive on file_name rule with specific patterns.
Cihat Gündüz
#2417 -
Fix crash in
no_fallthrough_only
and potentially other rules when linting
files with unicode characters in certain locations.
JP Simard
#2276 -
Fix violations with no character/column location not being reported in
xcpretty
. Now violations with no column location default to a column value
of1
indicating the start of the line.
JP Simard
#2267
0.28.2: EnviroBoost Plus
Breaking
- None.
Experimental
- None.
Enhancements
- Add
SWIFTLINT_DISABLE_SOURCEKIT
environment variable to allow running
SwiftLint without connecting to SourceKit. This will run a subset of rules
that don't require SourceKit, which is useful when running in a sandboxed
setting such as in Homebrew's CI.
Norio Nomura
Bug Fixes
- None.
0.28.1: EnviroBoost
This is the last release to support building with Swift 4.0 and Swift 4.1.
Breaking
- None.
Experimental
- None.
Enhancements
- None.