Draft:SwiftLint 2
![]() | This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
|
SwiftLint,[1] is a static code analysis tool for the Swift programming language, that aims to enforce good Swift style and conventions. The creator and lead developer is JP Simard.
Original author(s) | JP Simard |
---|---|
Initial release | May 30, 2015 |
Written in | Swift |
Operating system | macOS, Linux |
Available in | English |
Type | Static code analysis |
License | MIT |
Website | github |
SwiftLint is free software under the MIT license.
Features
SwiftLint's checks are implemented as rules, which are either on by default, or opt-in.
Over 230 rules are built in to SwiftLint, and users can define additional custom rules using regular expressions.
For example, the identifier_name
[2] rule warns, or errors if identifiers (e.g. variable and function names) are too short or too long, and allows the warning and error thresholds for length, as well as identifiers that should be ignored by the rule (such as x
and y
), to be configured.
SwiftLint is also capable of auto-correcting certain kinds of violations.
SwiftLint has an analyzer mode, which can check for unused code and imports using the abstract syntax tree, but runs more slowly than the usual lint mode.
See also
Lua error in mw.title.lua at line 346: bad argument #2 to 'title.new' (unrecognized namespace name 'Portal').
References
- ^ "SwiftLint". Website.
- ^ "identifier_name". Website.