Danny Mösch
325d0ee1e4
Consider custom attributes in `attributes` rule ( #4616 )
2023-01-31 22:34:11 +01:00
Danny Mösch
5eed8fe91b
Enable `if_let_shadowing` rule and fix all violations ( #4247 )
2023-01-31 22:31:38 +01:00
Danny Mösch
e64e82d80d
Get rid of periods finishing rule descriptions
2023-01-10 22:29:13 +01:00
JP Simard
4bd7da32ea
Reduce visibility of rules to be `internal` ( #4533 )
...
There's no reason to expose these publicly and this will make it nicer
to move to a new module outside of the core SwiftLint functionality.
2022-11-09 11:01:26 -05:00
Danny Mösch
0fbd03cf2b
Require visitors to exist ( #4383 )
2022-10-16 18:40:12 +02:00
Danny Mösch
f8e5339c69
Introduce `ReasonedRuleViolation` type to associate a reason with a violation position ( #4379 )
2022-10-16 12:53:38 +02:00
Danny Mösch
bd8c9e5bcb
Provide syntax visitor base class allowing for convenient skipping of declaration nodes ( #4310 )
2022-10-15 19:03:49 +02:00
JP Simard
4e3c750086
Rewrite `attributes` with SwiftSyntax ( #4359 )
...
Not 100% the same as it previously was, but I think all the changes
reported by OSSCheck are improvements or neutral.
2022-10-13 00:40:24 -04: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
JP Simard
027bdcdc95
Fix crash when parsing multi-line attributes with the `attributes` rule ( #3776 )
...
Fixes #3761
2021-12-06 16:08:53 +00:00
Danny Mösch
050473a0e1
Add optional prefer_self_in_static_references rule ( #3732 )
2021-11-29 18:42:53 +00:00
Dalton Claybrook
d305e03905
Add `inclusive_language` rule ( #3243 )
...
Current events have renewed the conversation in our community about the roles of terminology with racist connotations in our software. Many companies and developers are now taking appropriate steps to remove this terminology from their codebases and products. (e.g. [GitHub](https://twitter.com/natfriedman/status/1271253144442253312 )) This small rule prevents the use of declarations that contain any of the terms: whitelist, blacklist, master, and slave. It may be appropriate to add more terms to this list now or in the future.
2020-11-07 22:03:08 -05:00
Paul Taykalo
693ee2cae9
Add Isnot Empty extension in the Swift Framework ( #3387 )
2020-11-07 18:42:55 -05:00
JP Simard
2dcce6b184
[AttributesRule] Fix parameterized attributes ( #3405 )
...
Some attributes are parameterized, such as `@objc(name)`. Previously
these reported `attributes` violations because their contents weren't
included in the configuration, which would just have `@objc`.
2020-11-07 16:57:57 -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
28bec96b3e
Remove a usage of “blacklist”
2020-08-04 04:00:36 -07:00
Mateusz Matrejek
8ed7c31161
Fix false positive in with Swift 5.2 ( #3112 ) ( #3206 )
2020-05-27 22:13:46 +03:00
JP Simard
85d3425210
Fix attributes rule false positive with Swift 5.2 ( #3154 )
...
The following was triggering:
```swift
func printBoolOrTrue(_ expression: @autoclosure () throws -> Bool?) rethrows {
try print(expression() ?? true)
}
```
Fix by adding the `rethrows` attribute kind to the rule's blacklist.
2020-03-27 09:33:12 -07:00
Marcelo Fabri
a2fe35d620
Fix false positive in `attributes` with Swift 5.2 ( #3097 )
...
Fixes #3079
2020-02-09 18:17:45 -08:00
Marcelo Fabri
14da706ae9
Remove unused variable in AttributesRule ( #3090 )
2020-02-09 16:06:27 -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
73802c285d
Add own wrappers over syntax tokens and syntax map
2019-11-10 22:55:54 +02:00
Paul Taykalo
ac40778cb3
Use SwiftLintFile wrapper over the File
2019-11-07 15:19:17 +02:00
Paul Taykalo
b901c670d4
Cache file structure dictionary
2019-11-07 08:50:50 +02:00
Paul Taykalo
8c963d2c15
Working solution with SouceKittenDictionary wrapper
2019-11-07 08:50:50 +02:00
JP Simard
0e862ca9c4
Enable vertical whitespace rules in SwiftLint
...
and fix violations
2018-12-02 14:01:23 -08:00
JP Simard
3961d6482b
Organize rules by kind in Xcode project ( #2341 )
2018-08-05 18:54:05 -07:00