Commit Graph
15 Commits
Author SHA1 Message Date
Marcelo Fabri 8d9c501cb8 Add optional return_value_from_void_function rule using SwiftSyntax (#3054)
* Add optional return_value_from_void_function rule using SwiftSyntax

* Use Script/bootstrap in CI

* Make SwiftSyntax optional

* Make SwiftSyntax optional in SPM

* Fix Package.swift

* Try again

* Add minSwiftVersion

* Fix thread sanitizer issue

* Take 2

* Fix false positive on nested computed variables

* Remove support for Xcode 10.x

* Fix rule description

* Enable opt-in rule in configuration file

* Extract code into `SyntaxRule` protocol

* nit: make property private

* Missing docs

* Fix MasterRuleList.swift

* Update CHANGELOG

* Remove unused imports

* Use Example type

* Change rule kind to .idiomatic

* Update CHANGELOG

* Bump deployment target to macOS 10.12

* Simplify SyntaxRule.validate(file:visitor)

* Make TSan happy

* Use script/bootstrap in the README
2020-02-08 02:43:40 -08:00
JP Simard beaa2a8a87 Update Commandant and SourceKitten, drop Result (#2947) 2019-11-07 10:59:16 -08:00
JP Simard 45dd66bae6 Remove CryptoSwift dependency if not needed (#2485) 2018-11-26 16:31:26 -08:00
JP Simard d768897f1d Improve performance of collecting files to lint and lint cache lookups (#2465)
Performance has gotten pretty bad for complex SwiftLint configurations like the one used for Lyft's iOS code base involving lots of files in the directories being linted, large configuration files and many nested configuration files.

Two main areas were particularly ripe for improvement were:

1. Collecting which files to lint
2. Lint cache lookups

### Collecting which files to lint

Improve this by:

* using an NSOrderedSet to remove excluded paths instead of `Array.filter`
* parallelizing calls to `filesToLint` for all paths to lint and exclude
* using `FileManager.subpaths(atPath:)` instead of `enumerator(atPath:)`

|Change|Before|After|Speed up|
|-|-|-|-|
|NSOrderedSet|2.438s|0.917s|2.659x|
|Parallel Flat Map|2.438s|2.248s|1.085x|
|Subpaths|0.939s|0.867s|1.083x|
|**Total**|**2.438s**|**0.720s**|**3.386x**|

### Lint cache lookups

By using an MD5 hash of the Configuration description from CryptoSwift as the cache key instead of instead the full description, we can drastically speed up cache lookups for projects with complex SwiftLint configurations. I think the dictionary lookup for very large string keys doesn't perform very well.

---

* Speed up Configuration.lintablePaths

* Improve cache lookup performance by up to 10x

By using an MD5 hash of the Configuration description from CryptoSwift
as the cache key instead of instead the full description.

* Add changelog entries

* Swift 4.0 & Linux compatibility

* os(Darwin) isn't a thing

* Allow warnings in pod lib lint

SwiftLint supports building with Swift 4.0 to 4.2.

There is no version of CryptoSwift to support both Swift 4.0 and
Swift 4.2.

So allow warnings for now. We'll make one more Swift 4.0 compatible
release, then we'll bump the build requirements to Swift 4.2 and
remove the `--allow-warnings` flag.
2018-11-18 14:39:02 -08:00
Norio Nomura 7568ac1d10 Check in IDEWorkspaceChecks.plist 2018-04-08 13:28:09 +09:00
Norio Nomura 8e1f4e36b9 Switch the Result.xcodeproj referenced in the workspace to Carthage/Checkouts/Result 2017-11-25 22:44:20 +09:00
Norio Nomura b5cba7ae40 Replace YamlSwift with Yams 2017-04-03 09:16:04 +09:00
JP Simard 7acdc1dd6c bump dependencies 2016-12-18 16:57:21 -08:00
Scott Hoyt de02e082e9 Add SwiftyTextTable project to workspace. 2016-02-04 14:33:51 -08:00
JP Simard ace0999154 update SourceKitten to 0.8.0 2016-01-22 19:19:15 -08:00
JP Simard 8012fab729 remove Curry dependency
The syntax is going away in Swift 3, and it's not that hard to do ourselves.
2016-01-22 16:35:55 -08:00
JP Simard 98507c224c Automatically curry the LintOptions initializer for Commandant evaluation 2015-12-05 13:34:18 -08:00
JP Simard f7891827e4 added YamlSwift dependency 2015-08-27 14:21:17 -07:00
JP Simard e95625ee79 update for swift 2 2015-08-27 14:20:51 -07:00
JP Simard 767add47e8 First commit 2015-05-16 18:58:10 +02:00