Commit Graph

34 Commits

Author SHA1 Message Date
Danny Mösch 32152646f3
Use `Self` in constructor calls (#4505) 2022-11-02 22:50:22 +00:00
Danny Mösch 050473a0e1
Add optional prefer_self_in_static_references rule (#3732) 2021-11-29 18:42:53 +00:00
Paul Taykalo 693ee2cae9
Add Isnot Empty extension in the Swift Framework (#3387) 2020-11-07 18:42:55 -05:00
JP Simard 889dc49bb6
Remove support for compiling with 5.0.x (#3180)
* Remove support for compiling with 5.0.x

* fixup! Remove support for compiling with 5.0.x
2020-04-14 08:46:23 -07:00
JP Simard 399f5b7df6
Fix docstring formatting issues using DrString (#3032)
Using command:
$ drstring check -i 'Source/**/*.swift' --first-letter lowercase --vertical-align
2020-01-12 11:19:33 -08:00
JP Simard 37167a8a35
Add documentation comments to all public declarations (#3027) 2020-01-08 09:47:10 -08:00
JP Simard 3a0c2b0c05
Migrate LinterCache to use Codable models (#2799)
* Migrate LinterCache to use Codable models

improving performance and type safety

* Fix Linux

* Avoid creating a Decoder if it won't be used

For example if the file doesn't exist or can't be read.

* Use corelibs plist coder if available

It's available in the Swift 5.1 branch: https://github.com/apple/swift-corelibs-foundation/pull/1849

* Remove unused error case
2019-07-07 00:35:10 -07:00
Colton Schlosser 18e90be780 Split cache into one file per configuration (#2796)
* Split cache into one file per configuration

* Only write cache files with changes

* Avoid converting from Data -> String -> Data when saving cache files

* Move empty check to for where

* Split cache changelog entry

* Reword changelog entry to better reflect impact
2019-07-06 11:50:20 -07:00
JP Simard b83e0991b9
Remove all file headers
The MIT license doesn't require that all files be prepended with this
licensing or copyright information. Realm confirmed that they're ok with this
change. This will enable some companies to contribute to SwiftLint and the
date & authorship information will remain accessible via git source control.
2018-05-04 13:42:02 -07:00
Norio Nomura 2a0ac455bc
'flatMap' is deprecated: renamed to 'compactMap(_:)' 2018-04-08 13:28:09 +09:00
Marcelo Fabri ae0e21f0f8 Fix crash when saving cache
Fixes #2032
2018-03-24 21:23:14 -07:00
JP Simard 34f429b0a3
Fix caching on Linux
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`.
2017-10-26 12:23:13 -07:00
JP Simard b39b369d12
Fix setting Swift version when caching.
See https://github.com/realm/SwiftLint/pull/1790/files#r134323431.
2017-08-21 13:28:43 -07:00
Marcelo Fabri 0a07628d8c Invalidate cache when Swift version changes 2017-08-21 00:19:04 +02:00
Marcelo Fabri c01f4bd19f Enable extension_access_modifier rule 2017-07-21 21:08:52 +02:00
Marcelo Fabri e86763739f Move kind to RuleDescription 2017-07-02 15:50:16 +02:00
Marcelo Fabri 9a5e30e794 Split cache into read cache and write cache 2017-05-24 17:03:51 +02: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 690b567421
simplify serialized cache structure 2017-05-18 14:40:40 -07:00
JP Simard bd7169e40c
cache each file with its own configuration cache description
to make the cache play nicely with nested configurations
2017-05-18 14:31:33 -07:00
JP Simard 258a80b5cc
don't overwrite cache results from different versions 2017-05-18 14:31:33 -07:00
JP Simard 70bcb2c4e5
add LinterCache.Key enum
rather than use hardcoded, duplicate string literals
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
Marcelo Fabri 94f48f4ebd PR feedback 2017-01-10 13:09:18 -02:00
Marcelo Fabri 0cf433834e PR feedback 2017-01-05 12:01:47 -02:00
Marcelo Fabri e8ead8827b Make LinterCache thread-safe 2017-01-02 16:44:54 -02:00
Marcelo Fabri b3cd5008c0 Make LinterCache final 2016-12-31 01:42:18 -02:00
Marcelo Fabri 3d376241be Moving cache usage to the linter 2016-12-31 00:26:05 -02:00
Marcelo Fabri 77e4249a3d Improved cache structure 2016-12-31 00:24:54 -02:00
Marcelo Fabri a47385a64f Ignore cache if configuration has changed 2016-12-31 00:24:54 -02:00
Marcelo Fabri b1f62e2b63 Add some tests 2016-12-31 00:24:54 -02:00
Marcelo Fabri f1e33760f0 Fixing compile isse 2016-12-31 00:24:54 -02:00
Marcelo Fabri a92a24c598 Ignore cache when versions are different 2016-12-31 00:24:54 -02:00
Marcelo Fabri c698d021dc Initial cache implementation 2016-12-31 00:24:54 -02:00