Releases: realm/SwiftLint
0.12.0: Vertical Laundry
Breaking
- Fixed: SwiftLint assumes paths in the YAML config file are relative to the
current directory even when--path
is passed as an argument.
Cristian Filipov
Enhancements
- None.
Bug Fixes
0.11.2: Communal Clothesline
This release has seen a phenomenal uptake in community contributions!
Thanks to our many contributors: @AliSoftware, @bootstraponline, @bsarr007, @cfilipov, @d-ronnqvist, @daniel-beard, @freak4pc, @HaloZero, @krodak, @masters3d, @matthewellis, @mohpor and @woodhamgh.
Breaking
- None.
Enhancements
- Add
MarkRule
rule to enforce// MARK
syntax.
Krzysztof Rodak
#749 - Add
PrivateOutletRule
Opt-In rule to enforce@IBOutlet
instance variables to beprivate
.
Olivier Halligon - Add content of the todo statement to message.
J. Cheyo Jimenez
#478 - Add
LegacyNSGeometryFunctionsRule
rule. AddNSSize
,NSPoint
, and
NSRect
constants and constructors to existing rules.
David Rönnqvist - Added Vertical Whitespace Rule.
J. Cheyo Jimenez
#548 - Removed ConditionalBindingCascadeRule.
J. Cheyo Jimenez
#701 - Allow setting
flexible_right_spacing
configuration for thecolon
rule.
Shai Mishali
#730 - Add Junit reporter.
Matthew Ellis - LeadingWhitespaceRule is now auto correctable.
masters3d - Add included regex for custom rules to control what files are processed.
bootstraponline
#689 - Add rule to check for private unit tests (private unit tests don't get run
by XCTest).
Cristian Filipov - Add configuration for setting a warning threshold.
woodhamgh
696 - Adds 'ConditionalReturnsOnNewLineRule' rule.
Rohan Dhaimade - Made
- returns:
doc optional for initializers.
Mohpor
#557
Bug Fixes
- Fixed CustomRule Regex.
J. Cheyo Jimenez
#717
#726 - Allow disabling custom rules in code.
J. Cheyo Jimenez
#515 - Fix LegacyConstructorRule when using variables instead of numbers.
Sarr Blaise
#646 - Fix force_unwrapping false positive inside strings.
Daniel Beard
#721
0.11.1: Cuddles... Or Else!
Support for else
on new line (uncuddled) and LegacyCGGeometryFunctionsRule
fixes.
Breaking
- None.
Enhancements
- Added
statement_mode
configuration to thestatement_position
rule. The
default
mode keeps the current SwiftLint behavior of keepingelse
and
catch
statements on the same line as the closing brace before them. The
uncuddled_else
configuration requires theelse
andcatch
to be on a new
line with the same leading whitespace as the brace.
Mike Skiba
#651
Bug Fixes
- Remove extraneous argument label added in LegacyCGGeometryFunctionsRule
autocorrect.
Sarr Blaise
643
0.11.0: Laundromat Format
The big news in this release is that autocorrect will now optionally re-indent your Swift files like Xcode does.
Big thanks to Jorge Bernal, Norio Nomura, Brian Hardy, Reimar Twelker & Andrew Rahn for contributing to this release!
Breaking
- Now
type_name
allows lowercase enum values to match the Swift API Design
Guidelines.
Jorge Bernal
#654 - Embedding frameworks needed by
swiftlint
was moved from
SwiftLintFramework Xcode target to the swiftlint target.
TheSwiftLintFramework.framework
product built by the
SwiftLintFramework target no longer contains unnecessary frameworks or
multiple copies of the Swift libraries.
Norio Nomura
Enhancements
- Add
--format
option toautocorrect
command which re-indents Swift files
much like pasting into Xcode would. This option isn't currently configurable,
but that can change if users request it.
JP Simard - Improve error messages for invalid configuration files.
Brian Hardy - Added the user-configurable option
ignores_empty_lines
to the
trailing_whitespace
rule. It can be used to control whether the
TrailingWhitespaceRule
should report and correct whitespace-indented empty
lines. Defaults tofalse
. Added unit tests.
Reimar Twelker
Bug Fixes
- Fix false positive in conditional binding cascade violation.
Norio Nomura
#642 - Another conditional binding fix, this time for enum that has two parameters
or an if statement with two case tests.
Andrew Rahn
#667 - Fix regression in CommaRule ignoring violations when the comma is followed
by a comment.
Norio Nomura
#683
0.10.0: `laundry-select` edition
The big news in this release is that now SwiftLint will use the version of SourceKit & Xcode you have xcode-select
ed, and SwiftLint will no longer crash when SourceKit does! 🎉
Here's the full list of changes:
Breaking
- None.
Enhancements
- Now
libclang.dylib
andsourcekitd.framework
are dynamically loaded at
runtime by SourceKittenFramework to use the versions included in the Xcode
version specified byxcode-select -p
or custom toolchains.
Norio Nomura
#167 - Add
LegacyCGGeometryFunctionsRule
rule.
Sarr Blaise
#625 - SwiftLint no longer crashes when SourceKitService crashes.
Norio Nomura - Rewrite
conditional_binding_cascade
rule.
Norio Nomura
#617 - Add autocorrect for
ReturnArrowWhitespaceRule
.
Craig Siemens
Bug Fixes
- Failed to launch swiftlint when Xcode.app was placed at non standard path.
Norio Nomura
#593 ClosingBraceRule
no longer triggers across line breaks.
Josh Friend
#592LegacyConstantRule
andLegacyConstructorRule
failed toautocorrect
.
Norio Nomura
#623
0.9.2: Multiple Exhaust Codes
Breaking
- None.
Enhancements
- Return different exit codes to distinguish between types of errors:
VariableNameRule
now accepts symbols starting with more than one uppercase
letter to allow for names like XMLString or MIMEType.
Erik Aigner
#566
Bug Fixes
- Avoid overwriting files whose contents have not changed.
Neil Gall
#574 - Fix
CommaRule
mismatch between violations and corrections.
Norio Nomura
#466 - Fix more false positives in
ForceUnwrappingRule
.
Norio Nomura
#546
#547
0.9.1: Air Duct Cleaning
Breaking
- None.
Enhancements
- None.
Bug Fixes
- Fix force unwrap rule missed cases with quotes.
Norio Nomura
#535 - Fix issues with nested
.swiftlint.yml
file resolution.
Norio Nomura
#543
0.9.0: Appliance Maintenance
This is a big release, with lots of breaking changes and deprecations for users of SwiftLintFramework
. If we've removed functionality from the framework's public API that you were depending on, please let us know by filing an issue so we can consider adding it back in.
Breaking
Linter.reporter
has been removed andConfiguration.reporterFromString(_:)
has been renamed to a free function:reporterFromString(_:)
.
JP Simard_ConfigProviderRule
&ConfigurableRule
have been removed and their
requirements have been moved toRule
.
JP SimardConfiguration(path:optional:silent)
has been changed to
Configuration(path:rootPath:optional:quiet:)
.
JP Simard- The static function
Configuration.rulesFromDict(_:ruleList:)
has been moved
to an instance method:RuleList.configuredRulesWithDictionary(_:)
.
JP Simard - The
rules
parameter in theConfiguration
initializer has been renamed to
configuredRules
.
JP Simard - Removed a large number of declarations from the public SwiftLintFramework API.
This is being done to minimize the API surface area in preparation of a 1.0
release. See #507 for a
complete record of this change.
JP Simard
#479 - All instances of the abbreviation "config" in the API have been expanded to
"configuration". The--config
command line parameter and
use_nested_configs
configuration key are unaffected.
JP Simard - The
use_nested_configs
configuration key has been deprecated and its value
is now ignored. Nested configuration files are now always considered.
JP Simard
Enhancements
swiftlint lint
now accepts an optional--reporter
parameter which
overrides existingreporter
values in the configuration file. Choose between
xcode
(default),json
,csv
orcheckstyle
.
JP Simard
#440swiftlint rules
now shows a configuration description for all rules.
JP Simardlint
andautocorrect
commands now accept a--quiet
flag that prevents
status messages like 'Linting ' & 'Done linting' from being logged.
JP Simard
#386- All top-level keys in a configuration file that accept an array now also
accept a single value.
e.g.included: Source
is equivalent toincluded:\n - Source
.
JP Simard
#120 - Improve performance of
FunctionParameterCountRule
.
Norio Nomura - Improve performance of
ColonRule
.
Norio Nomura
Bug Fixes
- Fix case sensitivity of keywords for
valid_docs
.
Ankit Aggarwal
#298 - Fixed inconsistencies between violations & corrections in
StatementPositionRule
.
JP Simard
#466 - A warning will now be logged when invalid top-level keys are included in the
configuration file.
JP Simard
#120 - Fixed
LegacyConstructorRule
from correcting legacy constructors in string
literals.
JP Simard
#466 - Fixed an issue where
variable_name
ortype_name
would always report a
violation when configured with only awarning
value on eithermin_length
ormax_length
.
JP Simard
#522
0.8.0: High Heat
Breaking
- Setting only warning on
SeverityLevelsConfig
rules now disables the error
value.
Robin Kunde
#409 enabled_rules
has been renamed toopt_in_rules
.
Daniel Beard
Enhancements
- Add
whitelist_rules
rule whitelists in config files.
Daniel Beard
#256 - Improve performance of
ColonRule
,LineLengthRule
&syntaxKindsByLine
.
Norio Nomura - Add command to display rule description:
swiftlint rules <rule identifier>
.
Tony Li
#392 - Add
FunctionParameterCountRule
.
Denis Lebedev
#415 - Measure complexity of nested functions separately in
CyclomaticComplexityRule
.
Denis Lebedev
#424 - Added exception for multi-line
if
/guard
/while
conditions to allow
opening brace to be on a new line inOpeningBraceRule
.
Scott Hoyt
#355 - The
rules
command now prints a table containing values for:identifier
,
opt-in
,correctable
,enabled in your config
&configuration
.
JP Simard
#392 - Reduce maximum memory usage.
Norio Nomura
Bug Fixes
- Fix more false positives in
ValidDocsRule
.
diogoguimaraes
#451 - Fix
trailing_newline
autocorrect to handle more than one violation per
line.
Daniel Beard
#465 - Fix complexity measurement for switch statements in
CyclomaticComplexityRule
.
Denis Lebedev
#461
0.7.2: Appliance Manual
Breaking
- None.
Enhancements
- None.
Bug Fixes
- Fix several false positives in
ValidDocsRule
.
diogoguimaraes
#375