Changelog History
Page 5
-
v0.30.0 Changes
๐ฅ Breaking
- None.
Experimental
- None.
โจ Enhancements
โ Add
duplicate_imports
rule to prevent importing the same module twice.
Samuel Susla #1881Add
unused_setter_value
rule to validate that setter arguments are used in properties.
Marcelo Fabri #1136Add
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
-
v0.29.4 Changes
๐ฅ 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 #2441Improve
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
-
v0.29.3 Changes
๐ฅ Breaking
- None.
Experimental
- Skip
@IBInspectable
anddeinit
declarations inunused_private_declaration
.
JP Simard
โจ Enhancements
Allow configuring
discouraged_object_literal
rule to only discourage one kind of object literal.
Marcelo Fabri #2439Adds
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 FabriAdd
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 FabriFix false positives on
sorted_first_last
rule when callingsorted
with a different argument thanby:
(e.g. on a Realm collection).
Marcelo Fabri #2533Fix false positives on
redundant_objc_attribute
rule when using nested types.
Marcelo Fabri #2539Fix false positives on
vertical_whitespace_between_cases
rule when a blank line is present but it contains trailing whitespace.
Ben Staveley-Taylor #2538
-
v0.29.2 Changes
๐ฅ 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 #1518Add new opt-in rule
vertical_whitespace_closing_braces
to warn against empty lines before closing braces.
Cihat Gรผndรผz #1518Improve 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 #2108Improve
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
-
v0.29.1 Changes
๐ฅ Breaking
- None.
Experimental
- None.
โจ Enhancements
Add
redundant_objc_attribute
to warn against already implied@objc
attribute.
Daniel Metzing #2193Add
vertical_whitespace_between_cases
opt-in rule to enforce a single empty line between switch cases.
Cihat Gรผndรผz #1517Add
multiline_arguments_brackets
opt-in rule to warn against multiline function call arguments with surrounding brackets without newline.
Cihat Gรผndรผz #2306Add
multiline_literal_brackets
opt-in rule to warn against multiline literal arrays & dictionaries with surrounding brackets without newline.
Cihat Gรผndรผz #2306Add
multiline_parameters_brackets
opt-in rule to warn against multiline function definition parameters with surrounding brackets without newline.
Cihat Gรผndรผz #2306Ignore 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 #2489Fix false positives on
explicit_type_interface
rule when configured with optionallowRedundancy
set totrue
.
Cihat Gรผndรผz #2425Only 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
-
v0.29.0 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 inhomebrew-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 #2417Fix 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
- ๐ SwiftLint now requires Swift 4.2 or higher to build.
-
v0.28.2 Changes
๐ฅ 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.
-
v0.28.1 Changes
๐ This is the last release to support building with Swift 4.0 and Swift 4.1.
๐ฅ Breaking
- None.
Experimental
- None.
โจ Enhancements
- None.
๐ Bug Fixes
-
v0.28.0 Changes
๐ฅ Breaking
- ๐ Completely remove the
--use-tabs
option of theautocorrect
command that was deprecated in 0.24.1. In its place, define anindentation
key in your configuration files.
JP Simard
Experimental
โ Add a new
swiftlint analyze
command which can lint Swift files using the full type-checked AST. Rules of theAnalyzerRule
type will be added over time. The compiler log path containing the cleanswiftc
build command invocation (incremental builds will fail) must be passed toanalyze
via the--compiler-log-path
flag. e.g.--compiler-log-path /path/to/xcodebuild.log
JP Simardโ Add an
explicit_self
analyzer rule to enforce the use of explicit references toself.
when accessing instance variables or functions.
JP Simard #321โ Add an
unused_import
analyzer rule to lint for unnecessary imports.
JP Simard #2248Add an
unused_private_declaration
analyzer rule to lint for unused private declarations.
JP Simard
โจ Enhancements
โ Add
legacy_random
opt-in rule to encourage the use of.random(in:)
instead ofarc4random
,arc4random_uniform
, anddrand48
.
Joshua Kaplan๐ Improve performance of
line_length
andmultiple_closures_with_trailing_closure
rules.
Marcelo FabriAdd
closure_body_length
opt-in rule to enforce the maximum number of lines a closure should have. Requires Swift 4.2.
Ornithologist Coder #52โ Add SonarQube reporter.
Yusuke Ohashi #2350Add
prohibited_interface_builder
opt-in rule to validate that@IBOutlet
s and@IBAction
s are not used.
Marcelo Fabri #2365โ Add
inert_defer
rule to validate thatdefer
is not used at the end of a scope.
Marcelo Fabri #2123โ Add
toggle_bool
opt-in rule which suggests usingsomeBool.toggle()
oversomeBool = !someBool
. Requires Swift 4.2.
Dalton Claybrook #2369โ Add
identical_operands
opt-in rule to validate that operands are different expressions in comparisons.
Marcelo Fabri #1371โ Add
collection_alignment
opt-in rule to validate that all elements in a collection literal are aligned vertically.
Dalton Claybrook #2326โ Add
static_operator
opt-in rule to enforce that operators are declared as static functions instead of free functions.
Marcelo Fabri #2395Specify what type of compiler protocol initializer violated the
compiler_protocol_init
rule.
Timofey Solonin #2422
๐ Bug Fixes
๐ Fix
comma
rule false positives on object literals (for example, images).
Marcelo Fabri #2345๐ Fix false positive on
file_name
rule when using nested types.
Marcelo Fabri #2325Fix crash on
multiline_function_chains
rule when using some special characters inside the function calls.
Marcelo Fabri #2360๐ Change
autocorrect --format
to run format before autocorrect, fixing conflicts between default indentation and rules which modify indentation (i.e.closure_end_indentation
).
Ornithologist Coder #2374๐ Fix false positive on
empty_count
rule when assessing binary, octal and hexadecimal integer literals.
Timofey Solonin #2423
- ๐ Completely remove the
-
v0.27.0 Changes
๐ฅ Breaking
- None.
โจ Enhancements
Append
modifier_order
description with failure reason.
Daniel Metzing #2269Decrease default severity of
superfluous_disable_command
towarning
.
Frederick Pietschmann #2250Don't touch files when running
autocorrect --format
if the contents haven't changed.
Marcelo Fabri #2249Add
only_enforce_after_first_closure_on_first_line
configuration tomultiline_arguments
Mike Ciesielka #1896โ Add
anyobject_protocol
opt-in rule which suggests usingAnyObject
overclass
for class-only protocols.
Ornithologist Coder #2283Add options
prefix_pattern
andsuffix_pattern
to rulefile_name
.
Cihat Gรผndรผz #2309Add new bool config option
if_only
to ruleconditional_returns_on_newline
to specify that the rule should only be applied toif
statements.
Cihat Gรผndรผz #2307โ Add support for globs in
excluded
file paths.
Keith Smiley #2316๐ง Add
only_private
configuration toprefixed_toplevel_constant
rule.
Keith Smiley #2315Make rule
explicit_type_interface
compatible with ruleredundant_type_annotation
via new optionallow_redundancy
.
Cihat Gรผndรผz #2312โ Add
missing_docs
rule to warn against undocumented declarations.
Nef10 Andrรฉs Cecilia Luque #1652
๐ Bug Fixes
๐ Fix an issue with
control_statement
where commas in clauses prevented the rule from applying.
Allen WuFix
explicit_enum_raw_value
,generic_type_name
,implicit_return
,required_enum_case
,quick_discouraged_call
,array_init
,closure_parameter_position
andunused_closure_parameter
rules when linting with Swift 4.2.
Marcelo Fabri๐ Fix
identifier_name
rule false positives withenum
when linting using Swift 4.2.
Marcelo Fabri Jacob Greenfield #2231๐ Fix a crash when running with Swift 4.2.
Norio Nomura SR-7954๐ Fix false positive on
attributes
rule when linting a line that is below a line with a declaration that has attributes.
Marcelo Fabri #2297redundant_optional_initialization
rule now lints local variables.
Marcelo Fabri #2233Fix autocorrection for
redundant_type_annotation
rule.
Marcelo Fabri #2314