-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate Swift Syntax in the
force_cast
rule (#3867)
We've tried adding Swift Syntax support to SwiftLint in the past but had to turn it off in #3107 due to distribution and portability issues. With https://github.com/keith/StaticInternalSwiftSyntaxParser it should be possible to avoid those issues by statically linking the internal Swift syntax parser so it's available no matter where users have Xcode installed on their computer. By removing all calls to SourceKit (collecting comment commands + checking the current Swift version), there's a really significant performance improvement. | Framework | Mean [ms] | Min [ms] | Max [ms] | Relative | |:---|---:|---:|---:|---:| | SourceKit | 517.8 ± 8.3 | 505.5 | 531.1 | 6.59 ± 0.43 | | SwiftSyntax | 78.6 ± 5.0 | 72.6 | 92.1 | 1.00 | In practice, the SourceKit overhead will continue being there for as long as any rule being run is still looking up the SwiftLint syntax map though.
- Loading branch information
Showing
5 changed files
with
77 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters