Commit Graph

469 Commits

Author SHA1 Message Date
Norio Nomura 2a0ac455bc 'flatMap' is deprecated: renamed to 'compactMap(_:)' 2018-04-08 13:28:09 +09:00
Norio Nomura 7d0f239e2a Update dependencies
- Update SourceKitten from 0.19.1 to 0.20.0
- Update SWXMLHash from 4.3.6 to 4.6.0
- Update Yams from 0.5.0 to 0.7.0
2018-04-08 13:28:08 +09:00
Norio Nomura 2ab42cdec1 Fix typo 2018-04-05 11:17:35 +09:00
Norio Nomura c592538856 Add 4.1.0, 4.1.1 and 4.2.0 to Swift version detection 2018-04-05 10:29:54 +09:00
Ornithologist Coder faee8c935b Adds opt-in rule discouraged_optional_collection 2018-03-26 00:26:13 +02:00
Marcelo Fabri ae0e21f0f8 Fix crash when saving cache
Fixes #2032
2018-03-24 21:23:14 -07:00
Frederick Pietschmann 0f93373e8a Rename RuleIdentifier.explicit to .single 2018-03-21 07:47:16 +01:00
Frederick Pietschmann 48c9aeb08a Adjust all keyword architecture + docs 2018-03-21 07:42:46 +01:00
Frederick Pietschmann 00154e9631 Improve map syntax 2018-03-21 07:42:46 +01:00
Frederick Pietschmann 7ac75e92d2 Fix logic error in rule disable check 2018-03-21 07:42:46 +01:00
Frederick Pietschmann fdbc391e52 Improve all keyword-related code
As per PR #2095 review, suggested by @marcelofabri
2018-03-21 07:42:46 +01:00
Frederick Pietschmann 0ad2488d7e Add all keyword 2018-03-21 07:42:46 +01:00
Daniel Metzing 96d29817b4 Add untyped_error_in_catch opt-in rule 2018-03-17 12:54:51 -07:00
Davide Sibilio 5c8d6069b6 Implemented empty_string rule (#2064)
Added empty_string rule
2018-03-17 11:47:04 -07:00
Marcelo Fabri c875bed813 release 0.25.0 2018-02-11 22:15:36 -08:00
Marcelo Fabri 8c2c4b0a01 Fix false positive in empty_enum_arguments rule when using closures
Fixes #2041
2018-02-10 20:21:58 -08:00
Marcelo Fabri 03b4d6b020 Fix violations introduced when linting with Swift 4.1
Part of #2021
2018-02-03 22:23:48 -08:00
Marcelo Fabri d4346d2d37 Merge pull request #2013 from ornithocoder/optional_boolean
Adds opt-in discouraged_optional_boolean rule
2018-02-03 15:53:10 -08:00
Marcelo Fabri 5d7346b8a2 Don’t validate local vars in let_var_whitespace rule
As part of #2021
2018-01-25 20:00:31 -08:00
Marcelo Fabri 19c8536500 Fix false negative in unneeded_parentheses_in_closure_argument
Fixes #2017
2018-01-24 14:07:56 -08:00
Ornithologist Coder f485be257d Adds opt-in discouraged_optional_boolean rule 2018-01-22 00:44:23 +01:00
JP Simard 7bf32346cc release 0.24.2 2018-01-10 10:13:57 -08:00
JP Simard 7ad77df690 release 0.24.1 2018-01-08 15:21:59 -08:00
Ornithologist Coder 1295c5d182 Adds opt-in prefixed_toplevel_constant rule
Implements #1907.
2018-01-05 04:07:10 +01:00
JP Simard fa13551af1 Rename Configuration.Indentation to IndentationStyle
and move to its own file
2018-01-03 23:21:23 -08:00
JP Simard 5fd67018bb Fix comment alignment 2018-01-03 23:16:37 -08:00
Noah McCann fa5815e9f5 Extracted rule logic to separate function to address linting errors 2018-01-03 23:05:48 -08:00
Noah McCann ab29b75d20 Addressed most linting errors 2018-01-03 23:05:48 -08:00
Noah McCann 093367073a Renamed IndentationMode to Indentation, better handled default value 2018-01-03 23:05:48 -08:00
Noah McCann 38f869bf81 Added indentationMode to configuration, updated parsing to handle it 2018-01-03 23:05:48 -08:00
Ornithologist Coder a3c6a7f40c Adds opt-in discouraged_object_literal rule
Implements #1987.
2018-01-03 23:00:54 -08:00
Donald Ritter 1deddf2334 Adds a new rule which allows for enums that conform to protocol to
require cases.
2017-12-22 13:08:51 -05:00
JP Simard 1541f519b2 Merge pull request #1966 from joseprl89/feature/explicit_acl_rule
Add explicit acl rule to satisfy Issue #1649
2017-12-22 12:51:48 -05:00
Daniel Metzing f8f9c0e7f1 Introduction of Yoda condition checking.
This PR aims to implement [#1924][1].
[1]: https://github.com/realm/SwiftLint/issues/1924
2017-12-18 15:42:13 +01:00
Josep Rodríguez e150e5b92f Add explicit acl rule to satisfy Issue #1649 2017-12-02 20:39:42 +00:00
Ornithologist Coder 9d2c113ba8 Adds new opt-in rule, private_action
Implements #1931.
2017-11-17 18:13:48 +01:00
Norio Nomura 13768b70f6 Stop using numerical comparison in SwiftVersion 2017-11-16 11:53:29 +09:00
Norio Nomura d460c6d124 Invalidate cache when Swift patch version changes 2017-11-16 11:03:08 +09:00
JP Simard 06ece1ea8d release 0.24.0 2017-11-10 15:49:41 -08:00
Tom Quist 630a676921 Added rule to prefer min/max over sorted.first and sorted.last 2017-11-06 21:10:53 +01: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 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
Ornithologist Coder c7e3692ddf Adds quick_discouraged_pending_test opt-in rule
Implements #1909.
2017-10-17 14:49:36 +02:00
Ornithologist Coder b12280cfc2 Adds opt-in quick_discouraged_focused_test rule
Implements #1905.
2017-10-15 23:14:35 +02:00
Marcelo Fabri f971d4bc39 Add override_in_extension rule
Fixes #1884
2017-10-07 19:33:59 -03:00
Marcelo Fabri 96c6a13a92 Fix disabling superfluous_disable_command rule
Fixes #1890
2017-10-06 16:29:35 -03:00
Marcelo Fabri d4f4f5f35c Sort list of rule identifiers before printing them 2017-10-05 11:51:36 -03:00
JP Simard c57c47d66f Remove unnecessary Swift version differences 2017-10-04 13:49:40 -07:00