JP Simard
8d500d1a63
Rewrite empty_collection_literal with SwiftSyntax ( #4220 )
2022-09-19 12:39:35 +02:00
JP Simard
bc7792ecd6
Rewrite empty_string with SwiftSyntax ( #4177 )
2022-09-07 13:59:15 -04:00
JP Simard
117ef7f0e2
Rewrite flatmap_over_map_reduce with SwiftSyntax ( #4178 )
2022-09-07 13:23:51 -04:00
Kotaro Suto
3aa249b8a1
Fix first_where false negative ( #4105 )
2022-08-17 00:06:32 +00:00
Danny Mösch
d730e0b3fa
Let all example verification tests be generated by Sourcery ( #4076 )
2022-08-10 22:49:28 +02:00
Danny Mösch
449190d324
Verify examples in rules by default and enforce explicit exclusion ( #4065 )
...
A rule must conform to ManuallyTestedExamplesRule to skip generation of a test for its examples.
2022-08-09 22:32:09 +02:00
Marcelo Fabri
f880b66cbf
Rewrite operator_usage_whitespace with SwiftSyntax ( #3962 )
2022-05-06 16:48:57 -07:00
Marcelo Fabri
db2721f78e
Require Swift 5.0 in runtime ( #3886 )
...
* Require Swift 5.0 in runtime
* Fix violation
* Enable legacy_rule by default
* Update changelog
* Fix changelog after rebase
* More cleanup
2022-03-11 14:01:27 -08:00
Marcelo Fabri
678c3483ed
Fix regression in last_where rule with Swift 5.6 ( #3874 )
...
Fixes #3847
2022-03-08 07:53:56 -05:00
Paul Taykalo
693ee2cae9
Add Isnot Empty extension in the Swift Framework ( #3387 )
2020-11-07 18:42:55 -05:00
Marcelo Fabri
f8ef7d649c
Enable legacy_multiple and prefer_self_type_over_type_of_self in our codebase
2020-08-05 01:11:17 -07:00
Marcelo Fabri
6adf529e7e
Fix false positive in empty_string rule with multiline literals ( #3101 )
...
Fixes #3100
2020-02-10 08:27:44 -08:00
Zsolt Kovács
ab8cd43e67
Empty count configuration ( #3052 )
...
* Add `only_after_dot` configuration option to `empty_count` rule
* Update CHANGELOG.md
* Adopt Example wrapper
* Change severity level to error
2020-02-09 15:12:54 -08:00
Zev Eisenberg
fcf848608e
Add Inline test failure messages ( #3040 )
...
* Add Example wrapper in order to display test failures inline when running in Xcode.
* Stop using Swift 5.1-only features so we can compile on Xcode 10.2.
* Wrap strings in Example.
* Add Changelog entry.
* Wrap all examples in Example struct.
* Better and more complete capturing of line numbers.
* Fix broken test.
* Better test traceability.
* Address or disable linting warnings.
* Add documentation comments.
* Disable linter for a few cases.
* Limit mutability and add copy-and-mutate utility functions.
* Limit scope of mutability.
2020-02-02 10:35:37 +02:00
JP Simard
0b1140d874
Fix typo in examples for isEmpty
2020-01-16 16:29:11 -08:00
JP Simard
fe5baca7cd
Migrate to use SourceKitten's new ByteCount/ByteRange types ( #3037 )
...
New APIs were introduced in SourceKitten to allow for a more typesafe distinction between integers meaning NSString-based distances and byte-based distances.
* https://github.com/jpsim/SourceKitten/pull/639
* https://github.com/jpsim/SourceKitten/pull/642
This PR migrates SwiftLint's use of those APIs.
2020-01-16 15:18:37 -08:00
JP Simard
40ade98710
Update SourceKitten to 0.28.0 ( #3011 )
2020-01-03 16:47:18 -08:00
Paul Taykalo
ac40778cb3
Use SwiftLintFile wrapper over the File
2019-11-07 15:19:17 +02:00
Paul Taykalo
b1cdc119ec
Use swift enums instead of raw values
2019-11-07 11:05:19 +02:00
Paul Taykalo
8c963d2c15
Working solution with SouceKittenDictionary wrapper
2019-11-07 08:50:50 +02:00
Marcelo Fabri
d4ef1f0ad0
Add flatmap_over_map_reduce opt-in rule
...
Fixes #2883
2019-09-26 10:07:12 -07:00
Colton Schlosser
2c076151f4
Add contains_over_range_not_nil rule, make contains_over_first_not_nil also match == nil ( #2811 )
2019-09-03 12:03:00 -04:00
Colton Schlosser
130371b8cc
Add empty_collection_literal rule
2019-08-28 21:57:02 -04:00
Marcelo Fabri
3e115835b1
Merge pull request #2846 from realm/mf-contains_over_filter_is_empty
...
Add `contains_over_filter_is_empty` opt-in rule
2019-08-25 20:55:11 -07:00
Marcelo Fabri
67526344ef
Add contains_over_filter_is_empty opt-in rule
2019-08-25 20:22:41 -07:00
Marcelo Fabri
759ccd8a1e
Avoid false positives in contains_over_filter_count
2019-08-25 20:11:23 -07:00
Marcelo Fabri
00d2b5d772
Add contains_over_filter_count opt-in rule
...
Fixes #2803
2019-08-25 20:00:50 -07:00
JP Simard
230bedcd05
Bump ReduceIntoRule's minimum Swift version to Swift 4
2019-04-19 17:38:04 -04:00
Marcelo Fabri
ad2733391a
Merge pull request #2666 from daltonclaybrook/dc-reduce-into-rule
...
Add reduce_into opt-in rule
2019-04-15 14:52:04 -07:00
Marcelo Fabri
51d47d492c
contains_over_first_not_nil rule now also checks for firstIndex(where:)
...
Fixes #2678
2019-04-09 10:53:42 -07:00
r-plus
72dc428b2f
Add some non-triggering examples to SortedFirstLastRule
2019-04-02 10:40:43 +09:00
r-plus
c7a1cc1d54
fix: false positive on sorted_first_last with firstIndex(of:) and lastIndex(of:) method
...
Fixes #2700
2019-04-01 15:03:46 +09:00
Dalton Claybrook
0aa6c429fb
Fix build error on linux
2019-03-24 16:36:10 -04:00
Dalton Claybrook
1e69dd950a
Now the reduce_into rule is only triggered for COW types
2019-03-24 16:22:20 -04:00
Dalton Claybrook
92de850471
ReduceIntoRule is now an ASTRule
2019-03-24 16:22:20 -04:00
Xaver Lohmüller
57af7f0e30
Add ReduceBooleanRule ( #2675 )
...
* [reduce_boolean] Implement rule
* [reduce_boolean] Improve reason text
* [reduce_boolean] Fix new violations
* [reduce_boolean] Add CHANGELOG.md entry
* [reduce_boolean] Shorten rule name
* [reduce_boolean] Use regular map instead of compactMap
* [reduce_boolean] Match only possible syntax kinds
2019-03-10 10:54:14 -07:00
Cihat Gündüz
3c607f1f4a
[first_where] Make triggering example valid Swift code
2019-02-14 21:29:49 +01:00
Cihat Gündüz
5e1b491eea
[first_where] Fix code smells like suggested by @marcelofabri
2019-02-14 21:29:49 +01:00
Cihat Gündüz
09fb947887
[first_where] Prevent false positives by excluding some substructures
2019-02-14 21:29:49 +01:00
Cihat Gündüz
2d67f611b8
[first_where] Add false positives from #1930 as non-triggering examples
2019-02-14 21:29:49 +01:00
Marcelo Fabri
eafd98971d
Fix false positives on sorted_first_last with Realm
...
Fixes #2533
2018-12-25 19:25:53 -08:00
Marcelo Fabri
4b12e08731
Fix false positives on Realm collections
2018-12-25 18:41:53 -08:00
Marcelo Fabri
c17e269cee
Add last_where opt-in rule
2018-12-25 01:34:42 -08:00
JP Simard
0e862ca9c4
Enable vertical whitespace rules in SwiftLint
...
and fix violations
2018-12-02 14:01:23 -08:00
Timofey Solonin
e9d2552888
#2423 - Fix EmptyCountRule for binary, octal and hexadecimal integer literals
2018-10-02 19:47:52 +03:00
JP Simard
3961d6482b
Organize rules by kind in Xcode project ( #2341 )
2018-08-05 18:54:05 -07:00