Commit Graph

13 Commits

Author SHA1 Message Date
Marcelo Fabri 0163ffd328
Cache folded syntax tree (#4744) 2023-02-06 10:39:36 -08:00
Marcelo Fabri 7bd8362dae
Fix false positive on `private_subject` (#4646)
Fixes #4643
2022-12-19 13:31:34 -03:00
JP Simard 18f9a0e3a6
Write some docs for internal APIs (#4550)
These should be useful when writing rules, but also may become public
API in the future.
2022-11-16 13:58:55 -05:00
Danny Mösch 3864ecc12f
Fix indentation in error message (#4528) 2022-11-07 14:47:14 -05:00
Marcelo Fabri 7b1099a33d
Rewrite `prefixed_toplevel_constant` with SwiftSyntax (#4425) 2022-10-21 13:11:40 -07:00
Danny Mösch a8bc9e9b42
Let more rules rely on SwiftSyntaxRule's defaults (#4401) 2022-10-18 02:23:39 -04: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
Marcelo Fabri 9959f971f9
Add way to preprocess syntaxTree in SwiftSyntaxRule (#4381)
* Add way to preprocess syntaxTree in SwiftSyntaxRule

* Update Source/SwiftLintFramework/Protocols/SwiftSyntaxRule.swift

Co-authored-by: Danny Mösch <danny.moesch@icloud.com>

* Update Source/SwiftLintFramework/Protocols/SwiftSyntaxRule.swift

Co-authored-by: Danny Mösch <danny.moesch@icloud.com>

Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2022-10-16 01:40:02 -07: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 0282bf1923
Remove optionality in getting syntax tree and source location converter (#4353)
Parsing does not throw errors.
See https://github.com/apple/swift-syntax/pull/912.
2022-10-12 12:50:17 -04:00
Danny Mösch ab3f070222
Introduce `SeverityBasedRuleConfiguration` to avoid custom `makeViolation`s (#4274) 2022-10-04 07:39:07 +02:00
JP Simard 5a30991fa4
Add SwiftSyntax rule helpers (#4126)
This cuts down on the boilerplate involved in writing SwiftSyntax-based
rules. May not be significant right now since most rules are still built
with SourceKit, but as we migrate more rules moving forward, this should
make it easier for rule authors to write rules that behave performantly
and correctly.
2022-08-26 14:46:32 +00:00