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
Marcelo Fabri
d1cc128660
release 0.23.0
2017-10-03 21:55:00 -03:00
Marcelo Fabri
81b832c372
Add literal_expression_end_indentation opt-in rule
2017-10-02 02:09:45 -03:00
Marcelo Fabri
192411f9c4
Add unneeded_break_in_switch rule
...
Fixes #1870
2017-10-02 00:21:27 -03:00
Marcelo Fabri
41f8b1971d
Merge pull request #1862 from sirlantis/add-new-multiline-arguments-rule
...
Add MultilineArgumentsRule
2017-10-02 00:20:28 -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
Marcel Jackwerth
4945ee29b7
Add MultilineArgumentsRule
2017-09-29 23:08:46 +02:00
Samuel Susla
9dcb3dbeb7
Add contains_over_first_not_nil rule
2017-09-17 15:59:40 +01:00
Marcelo Fabri
8f05f92cd1
Add array_init opt-in rule
...
Fixes #1271
2017-09-16 02:32:48 -03:00
Austin Lu
b2a17026cc
Add SwitchCaseAlignmentRule
2017-09-12 09:26:42 -07:00
Marcelo Fabri
4f0dbfb686
Add fallthrough opt-in rule
...
Fixes #1834
2017-09-11 01:53:40 -03:00
JP Simard
01e4831a7c
Update for Swift 4 in Xcode 9 beta 6 and latest Linux snapshot
2017-09-10 13:48:37 -07:00
Marcelo Fabri
03edafae15
Merge pull request #1797 from marcelofabri/rules-tests
...
Validate rules docs when running unit tests
2017-09-08 00:41:22 -03:00
Marcelo Fabri
f074ff7f47
release 0.22.0
2017-08-30 14:38:04 -03:00
Erik Strottmann
6fca21cdf6
Add multiple_closures_with_trailing_closure rule
...
Multiple Closures with Trailing Closure rule disallows trailing closure
syntax when passing more than one closure argument to a function.
Fixes #1801 .
2017-08-27 22:03:22 -07:00
Maz Jaleel
03676c9772
Add No Grouping Extension Rule ( #1789 )
2017-08-27 22:10:05 +01:00
Marcelo Fabri
54f9c22c60
Fix existing violations
2017-08-26 10:05:56 -03:00
Marcelo Fabri
d082f96284
Add pattern_matching_keywords rule
2017-08-26 10:05:56 -03:00
Maz Jaleel
5335060935
update rule name
2017-08-26 07:15:54 +04:00
Maz Jaleel
742bb2fd8f
initial rule implementation
2017-08-26 07:07:06 +04:00
Marcelo Fabri
43925199d4
Validate rules docs when running unit tests
...
Fix #1734
2017-08-24 21:27:35 +02:00
JP Simard
d830392c95
make sourcery
2017-08-22 09:43:44 -07:00
JP Simard
2c94e54bd6
Fix 'is_disjoint' violations in SwiftLint itself
2017-08-21 16:00:34 -07:00
JP Simard
ef3df839ce
Add is_disjoint rule
...
to encourage using `Set.isDisjoint(with:)` over `Set.intersection(_:).isEmpty`.
2017-08-21 16:00:33 -07:00