Commit Graph

29 Commits

Author SHA1 Message Date
Danny Mösch 4065fc8437 Enable upcoming feature MemberImportVisibility (#6286) 2025-10-08 08:12:05 +02:00
Danny Mösch 8ada387884 Ignore locally defined count identifiers in empty_count rule (#6202) 2025-08-24 14:08:40 -04:00
Danny Mösch c1ffdfe891 Enable prefer_condition_list rule (#6163) 2025-07-12 09:41:00 -04:00
Danny Mösch 599e51a5a2 Format code (#6151) 2025-07-02 17:50:53 -04:00
Danny Mösch 47335d7f95 Remove tracking of correction positions (#5950)
Report number of corrections per file instead.
2025-04-05 06:04:37 -04:00
Koichiro Ueki fc70594ad2 Ignore TipKit's #Rule macro in empty_count rule (#5918)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2025-01-07 09:22:10 -05:00
Danny Mösch ff21ff796c Specify rule properties in attribute 2024-12-26 20:40:29 +01:00
Danny Mösch 1d26f4c0ef Let descriptions be immutable (#5729) 2024-08-05 17:09:50 -04:00
Martin Redington ed10aec5f8 Enable implicit_return and fix all violations (#5658) 2024-07-10 12:15:19 +01:00
Danny Mösch c810459e6a Enforce mandatory trailing comma and fix all violations (#5640) 2024-06-28 05:36:50 +00:00
deterclosed 082adfaed7 Fix some typos (#5504) 2024-03-23 15:25:16 +01:00
Danny Mösch 5bfe329d09 Update SwiftSyntax to version 510.0.0 (#5479) 2024-03-09 15:46:45 -05:00
Danny Mösch c730047176 Enable superfluous_else rule (#5412) 2024-03-03 16:30:44 +01:00
Danny Mösch 4078e41f1b Let all rewriters have a configuration by default (#5467) 2024-02-11 15:13:24 +01:00
Kotaro Suto f0c1780b53 Make empty_count rule correctable (#5409) 2024-01-29 20:15:51 +01:00
Danny Mösch ddaf3d22ad Add new final_test_case rule (#5396) 2023-12-20 20:59:03 +01:00
JP Simard 3eb3772022 Compile with -strict-concurrency=complete (#5320)
* Compile with `-strict-concurrency=complete`

Only in Bazel for now, because this is considered an unsafe flag in
SwiftPM which would lead to warnings for downstream consumers of
SwiftLint using SwiftPM.

Some imports of SwiftSyntax need the `@preconcurrency` annotation until
https://github.com/apple/swift-syntax/pull/2322 is available in a
release.

The following SwiftLint libraries have `-strict-concurrency=complete`
applied:

* SwiftLintCoreMacros
* SwiftLintBuiltInRules
* SwiftLintExtraRules

The following SwiftLint libraries don't have the flag applied and need
to be migrated:

* SwiftLintCore
* swiftlint (CLI target)

So really the rules and macros are now being compiled with
`-strict-concurrency=complete`, but the core infrastructure of SwiftLint
is not.

Still, given that Swift 6 will eventually make these warnings errors by
default, it's good to prevent issues from creeping in earlier rather
than later.

* Add CI job to build with strict concurrency
2023-11-01 15:20:40 +00:00
Danny Mösch 40bd97038a Support arbitrary configurations in @SwiftSyntaxRule (#5275)
Almost all rules based on SwiftSyntax can be set up now by just adding
`@SwiftSyntaxRule` to the rule struct.
2023-10-16 19:34:43 +02:00
Danny Mösch 2ed1fc2f27 Let all rules be configurable (#5274) 2023-10-12 17:30:45 +02:00
Danny Mösch f6e5f778fc Configure expression folding by argument of @SwiftSyntaxRule macro (#5255) 2023-10-03 07:16:33 -04:00
JP Simard 591154091e Introduce @SwiftSyntaxRule & @Fold macros (#5253)
These macros remove some of the boilerplate involved when writing rules.

This change also adds test infrastructure for the macros used within
SwiftLint.
2023-10-02 18:43:16 -04:00
Danny Mösch b281a8d33a Update SwiftSyntax (#5168) 2023-08-30 22:57:10 +02:00
Danny Mösch f10fc3056b Remove superfluous newline characters from examples (#5158) 2023-08-06 12:23:26 -04:00
Danny Mösch 85c4a3a03d Revert "Allow to initialize Examples by string literals (#5154)" (#5155)
This reverts commit 56461c3ab4.
2023-08-04 00:03:26 +02:00
Danny Mösch 56461c3ab4 Allow to initialize Examples by string literals (#5154) 2023-08-03 23:03:41 +02:00
woxtu 156f6aabc8 Fix false positives in sorted_first_last rule when first/last have a predicate (#5038) 2023-06-11 17:22:06 +02:00
Danny Mösch 3f039f26d5 Connect configs with their referencing rules to have some context in error logging (#5017)
With the binding of configurations to their associated rule types
"unknown configuration" errors can be made more specific mentioning
also the rule's identifier in the printed message.
2023-05-19 20:58:24 +02:00
JP Simard 6b094dd711 [SwiftSyntax] Update to latest 509.0.0 tag (#4920)
* [bazel] Remove custom SwiftSyntax BUILD file

Something similar to this has been merged upstream instead now. This
also renames the repo name to SwiftSyntax in preparation for it being in
the BCR

* [SwiftSyntax] Update to latest 509.0.0 tag

https://github.com/apple/swift-syntax/releases/tag/509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-04-25-b
2023-05-03 11:34:26 -04:00
JP Simard a7bc9e20c7 Move built-in rules to new SwiftLintBuiltInRules module (#4950) 2023-04-27 11:16:01 -04:00