* Add new multiline_literal_brackets rule with examples
* Implement rule
* Add changelog entry
* Fix CHANGELOG and rule name
* Fix tests + Update stuff after rebasing
* Add more examples & fix whitespace issue
* Address feedback from @ornithocoder
* Add multiline rules for arguments and parameters
* Fix false positives in rule multiline_parameters_brackets
* Fix false positive for trailing closures in multiline_arguments_brackets
* Add nested examples to rule multiline_arguments_brackets
* Fix more false positives in multiline_arguments_brackets rule
* Use guard where appropriate instead of if
* Update generated artifacts after rebase
* Add CHANGELOG entry for all three new rules
* Move changelog entries to new version
* Fix changelog entries position
* Move new rules to correct subfolder
* Update Rules.md file contents
* Fixup changelog
* Refactor rules
Motivation:
Sometimes, Homebrew bottling CI fails because it runs in the sandbox.
Modifications:
Add `testSimulateHomebrewTest()` to `IntegrationTests` that simulates test in `homebrew-core/Formula/swiftlint.rb` within sandbox.
Result:
Confirm that a test equivalent to `brew test swiftlint` will pass in the sandbox before publishing to homebrew.
This can be used for avoid "Test::Unit::AssertionFailedError" error in `libxpc.dylib` on calling `sourcekitd_send_request_sync` in sandbox environment.
This bumps the minimum version required to build SwiftLint to 4.2. The primary motivating factor to drop support for Swift 4.0-4.1.x is that SwiftLint now uses CryptoSwift, which requires 4.2.
* Add changelog entry
* Remove --allow-warnings flag from CocoaPods commands
* Update CryptoSwift to 0.13.0
* Migrate to Swift 4.2
* Remove CircleCI tests for Swift < 4.2
* Update English and Chinese README
Korean README doesn't yet have a version table like this.
* Update gems
* Add changelog entry for fixed compiler warnings
* Update CocoaPods to 1.6.0.beta.2
To work around https://github.com/CocoaPods/CocoaPods/issues/7708
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.