Commit Graph

142 Commits

Author SHA1 Message Date
JP Simard 3a32d6b479 Speed up reading cached results by about 200%
also slightly speed up writing to the cache.

For example, on the Lyft codebase with 1,500 Swift files:

```bash
$ time swiftlint lint --quiet
swiftlint --quiet  3.53s user 0.27s system 388% cpu 0.979 total
$ rm -rf ~/Library/Caches/SwiftLint && time swiftlint lint --quiet
swiftlint --quiet  35.20s user 1.22s system 371% cpu 9.806 total
$ time swiftlint lint --quiet
swiftlint lint --quiet  0.90s user 0.13s system 218% cpu 0.472 total
$ rm -rf ~/Library/Caches/SwiftLint && time swiftlint lint --quiet
swiftlint lint --quiet  31.78s user 1.18s system 360% cpu 9.146 total
```
2017-10-19 23:17:01 -07:00
JP Simard 08e0c816f3 Make Configuration conform to Hashable 2017-10-19 22:50:07 -07:00
JP Simard 757443d201 Correct and speed up equality checks for Configuration values
they previously didn't account for `warningThreshold` or `cachePath`.
2017-10-19 22:28:04 -07:00
Marcelo Fabri d4f4f5f35c Sort list of rule identifiers before printing them 2017-10-05 11:51:36 -03:00
Marcelo Fabri be341f90b9 Introduce queuedFatalError
`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.
2017-09-30 15:07:23 -03:00
Marcelo Fabri 54f9c22c60 Fix existing violations 2017-08-26 10:05:56 -03:00
Marcelo Fabri d4248e9b12 Fix tests on Linux 2017-08-17 20:36:44 +02:00
Stéphane Copin 3ad4842bcd Small changes and refactoring based on github Feedback 2017-08-02 13:05:26 -07:00
Stéphane Copin 9f1f454cf9 Refactor the way Configuration objects are created with regards to rules 2017-08-02 13:05:26 -07:00
Stéphane Copin 97c1dcd0fa Add support for nested configuration
Original commit here: https://github.com/realm/SwiftLint/commit/9eef125245e43a8ff333d45abd13f9f0177d7258

Significant modifications made by @jpsim
2017-08-02 13:05:26 -07:00
Marcelo Fabri 663081cfbd Fix crash when using --config and --path with a Swift file
Fixes #1694
2017-07-19 20:53:55 +02:00
JP Simard 7592d9247a use cached configurations if available when initializing 2017-07-17 16:35:16 -07:00
JP Simard d0c8e5ee60 reorganize Configuration.swift 2017-07-17 12:05:05 -07:00
JP Simard 40bd4e7d4f move parsing functionality to Configuration+Parsing 2017-07-17 12:05:05 -07:00
JP Simard e6f95d5723 move merging functionality to Configuration+Merging 2017-07-17 12:05:04 -07:00
JP Simard 8f8e5d1fc2 move "lintable files" functionality to Configuration+LintableFiles 2017-07-17 11:45:32 -07:00
JP Simard 283055623a prefer early return in containsDuplicateIdentifiers(_:) 2017-07-17 11:42:03 -07:00
Marcelo Fabri 68c1f3c1ab Fix configuration issue when using custom paths
Fixes #1631
2017-06-24 22:54:10 +02:00
JP Simard a6487db198 fix using incorrect config file (fixes #1531) 2017-06-13 21:32:56 +02:00
JP Simard eef39595f6 move cache-related Configuration code into Configuration+Cache.swift 2017-05-23 11:22:55 -07:00
JP Simard b19e0de6e4 fix non-root configs logging warnings more than once 2017-05-23 11:22:55 -07:00
JP Simard ca08d6598a move LinterCache+CommandLine to SwiftLintFramework
and make cacheURL an internal member of Configuration
2017-05-18 14:53:39 -07:00
JP Simard 97bdac211a keep a single cache file for all of SwiftLint 2017-05-18 14:45:46 -07:00
JP Simard f639ae95f1 add CacheDescriptionProvider protocol
to provide more complete descriptions for cache invalidation
purposes.
2017-05-18 14:31:33 -07:00
JP Simard 903b48f4da derive Configuration.cacheDescription in all cases
rather than just when using one of many code paths in one of many
initializers
2017-05-18 13:59:24 -07:00
Víctor Pimentel 5ed010c9c0 Change LinterCache to use file modification dates instead of hashing files with a weak algorithm. 2017-05-18 13:39:05 -07:00
JP Simard 385d726e52 simplify Configuration.swift's usage of its default file manager 2017-05-18 13:04:09 -07:00
JP Simard 1b69b90691 remove superfluous string interpolation of a single String 2017-04-06 13:33:38 -07:00
Norio Nomura b4f85d873a Make yaml error message to be locatable by Xcode’s Issue Navigator 2017-04-05 12:45:27 +09:00
JP Simard df6cfa4d56 use enableAllRules in Configuration.swift 2017-01-12 14:13:48 -08:00
Marcelo Fabri e6155ea76e Fix excluded configuration not excluding files.
Fixes #1166
2017-01-12 00:36:59 -02:00
JP Simard 86214a7758 remove trailing comma from array 2017-01-10 15:31:55 -08:00
Marcelo Fabri 2a97a1cd3d PR feedback 2017-01-10 20:53:17 -02:00
Marcelo Fabri 66d0bb2eb8 Update how hash is calculated 2017-01-10 20:49:53 -02:00
Marcelo Fabri c28e3080f1 Get hash from parsed dictionary instead of String 2017-01-10 18:14:19 -02:00
Marcelo Fabri 94f48f4ebd PR feedback 2017-01-10 13:09:18 -02:00
Marcelo Fabri e1e2369c5f Merge branch 'master' into cache 2017-01-10 12:54:30 -02:00
JP Simard 1e48ffb8fc address some PR feedback 2017-01-09 19:17:27 -08:00
JP Simard c5c2e21120 update SwiftLintFramework/Models to follow Swift 3 API Design Guidelines 2017-01-09 19:05:29 -08:00
JP Simard a291bb594a update SwiftLintFramework/Extensions to follow Swift 3 API Design Guidelines 2017-01-09 17:53:07 -08:00
Marcelo Fabri 20620d5b6e Merge branch 'master' into cache 2017-01-07 12:54:27 -02:00
JP Simard 9d697bf7a2 add .swiftlintVersion member to validKeys 2017-01-07 00:13:48 -08:00
JP Simard 6979d25733 allow specifying a swiftlint_version configuration key
which will log a warning if the current running version of SwiftLint
is different than this value.
2017-01-07 00:09:29 -08:00
Marcelo Fabri b1b9027663 Merge branch 'master' into cache 2017-01-06 21:06:50 -02:00
JP Simard 36b1ea0ba4 fix linting directories ending in .swift 2017-01-06 11:33:21 -08:00
Marcelo Fabri 8af6552b73 Merge branch 'master' into cache 2017-01-04 13:37:24 -02:00
JP Simard cce3505f1b pass function reference rather than create a small closure 2017-01-03 23:30:55 -08:00
Marcelo Fabri 12a66d4fe1 Remove handleAlias function 2017-01-03 18:04:37 -02:00
Marcelo Fabri 3b682fb116 Remove support to non-deprecated aliases 2017-01-03 16:14:34 -02:00
Marcelo Fabri a5683fa393 PR feedback 2017-01-02 16:21:10 -02:00