This has never worked for two reasons:
1. We've used dictionaries to represent cache descriptions, which
don't guarantee stable ordering of keys across invocations.
This is true both on Darwin and Linux, but in practice ordering
varies significantly more on Linux.
2. Storing a `TimeInterval` value in a `[String: Any]` dictionary
and retrieving it again will not be dynamically castable to
`Double` or `TimeInterval` but will be castable to `Int`.
* Fix superfluous disable command producing false positives
* Fix import formatting assumptions:
* Exactly once space after `import`
* No support for `@testable import`
* Reduce indentation
* Omit types when they can be inferred
* Omit explicit references to `self.`
* Fix typos in comments
* Make constrained extensions more generic
* Use explicit ACLs for all declarations
For a function that takes a closure as default value, the array of
parameter reported by sourcekit also includes the parameters of that
closure.
In other words, a function like
func foo(param1: Int,
param2: Bool,
param3: (Int) -> Void = { (x: Int) in }) { }
reports 4 parameters (param 1, param2, param3, and x).
This commit uses the bounds of the method/function parameters to filter
out parameters within parameters. Below, a 1, a 2, and a 3 would be
filtered out since they're inside parameter 3.
----------------------------------------------------------------|
| |---------| |---------| |----------------------------| |
| | param 1 | | param 2 | | param 3: |a 1| |a 2| |a 3| | |
| |---------| |---------| |----------------------------| |
----------------------------------------------------------------|
* fdescribe
* fcontext
* fi
* xdescribe
* xcontext
* xit
are valid Quick calls and should not trigger this violation.
There should be another SwiftLint rule to discourage the use of focused
tests, so people don't commit and push code with focused tests.
`fatalError` prints the full path of the file, which leaks filesystem information from the machine that built the binary. Now that we release via CocoaPods, this is more critical.