Commit Graph
19 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 2d0d56985f Clean up CryptoSwift references (#2522)
* Clean up CryptoSwift references

* Add a changelog entry

* Remove unused import
2018-12-20 10:59:49 -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
JP Simard 284a7d5828 Point SwiftyTextTable to official repo & stable release of 0.8.0
Partially resolves #1962.
2017-12-22 10:49:33 -05:00
JP Simard 258ed9c196 Update dependencies
mostly to address previous deprecation warnings when compiling with
Swift 4.0.2.
2017-11-10 14:37:53 -08: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 fac636508e Add SwiftyTextTable via carthage. 2016-02-04 14:31:33 -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 fb09dcd701 add thoughtbot/Curry to Cartfile.private and update SourceKitten 2015-12-05 13:22:38 -08:00
JP Simard c6800e1ace update dependencies & lint parameter variables 2015-11-03 12:31:37 -08:00
JP Simard 3ac2fa2ce6 behrang/YamlSwift 2015-08-28 12:47:36 -07:00
JP Simard 57a8abb514 update for Xcode 7 Beta 6 2015-08-27 14:21:17 -07:00
JP Simard f7891827e4 added YamlSwift dependency 2015-08-27 14:21:17 -07:00
JP Simard 29536759d1 update for Xcode 7 Beta 6 2015-08-27 14:20:51 -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