Commit Graph

78 Commits

Author SHA1 Message Date
Danny Mösch ebf7c708b7 Stop triggering mark rule in the middle of another comment (#5593) 2024-05-17 22:29:26 +02:00
Danny Mösch 40bee88132 Respect configuration in unneeded_override rule's rewriter (#5579) 2024-05-15 14:16:01 -04:00
Danny Mösch 4a72167b95 Check that a reference is not just extended 2024-05-03 22:26:21 +02:00
Danny Mösch 5f8fe00bf9 Pass an entity's parent to the traversal block as well 2024-05-03 22:26:21 +02:00
Martin Redington 7623f1e730 Enable more rules in SwiftLint's own .swiftlint.yml (#5532) 2024-04-27 18:43:08 +02:00
Martin Redington dd8789b530 Update blanket_disable_command rule reason and description (#5518) 2024-04-04 16:25:06 +00:00
deterclosed 082adfaed7 Fix some typos (#5504) 2024-03-23 15:25:16 +01:00
Matt Thompson 9259698eef Make private_swiftui_state rule correctable (#5447) 2024-03-18 20:58:45 +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 ed0241abf4 Move @preconcurrency attribute to script (#5492) 2024-03-09 14:50:42 +01: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
Danny Mösch c874c4e692 Make use of marker protocol (#5463) 2024-02-09 23:34:26 +01:00
Hayashi Tatsuya 2be8846ad3 Rewrite orphaned_doc_comment rule with SwiftSyntax (#5417) 2024-01-21 09:20:12 +01:00
Hayashi Tatsuya 2f15f66fca Rewrite mark rule using SwiftSyntax (#5408) 2024-01-09 22:44:47 +01:00
Danny Mösch a8a676f479 Merge return_value_from_void_function and discouraged_void_return rules (#5403) 2023-12-26 11:23:27 +01:00
Danny Mösch 77a9d3ccc6 Add discouraged_void_return rule (#5400) 2023-12-22 15:21:36 +01:00
Danny Mösch e4e22b5b8a Improve discarded_notification_center_observer rule (#5371) 2023-12-04 22:06:12 +01:00
Ben P 544e1c60c7 Add a new non_optional_string_data_conversion rule (#5264) 2023-12-02 07:33:22 -05:00
Kishikawa Katsumi 0d54c2a10d Rewrite opening_brace rule with SwiftSyntax (#5164) 2023-12-02 12:21:50 +01:00
Leonardo de Sousa Rodrigues eecb44db6e Add option to make unneeded_override rule affect initializers (#5270) 2023-11-30 21:35:53 +01:00
Danny Mösch 8cb2cf9f85 Rewrite let_var_whitespace rule with SwiftSyntax (#5367) 2023-11-29 22:45:06 +01:00
Danny Mösch eab0af851c Rewrite identifier_name rule with SwiftSyntax (#5354) 2023-11-19 12:47:41 +01:00
Danny Mösch 9cd47401c0 Ignore functions with default parameters in unneeded_override rule (#5356) 2023-11-16 22:44:10 +01:00
Danny Mösch 1603f4ab55 Remove filter that is assuming classes cannot be nested inside of extensions (#5344) 2023-11-11 14:28:16 +01:00
JP Simard 6e3bfc1a45 Fix more strict concurrency warnings (#5324)
These aren't enough to enable `-strict-concurrency=complete` for more
modules, but they address some warnings with that flag on and reduces
the scope of what remains to be migrated.
2023-11-01 12:41:54 -04: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
Marcelo Fabri 5466f96818 Conform BlanketDisableCommandRule to SourceKitFreeRule (#5306) 2023-10-28 23:39:14 -07:00
Marcelo Fabri 491cf5e227 Conform InvalidSwiftLintCommandRule to SourceKitFreeRule (#5304) 2023-10-28 21:57:59 -07:00
Danny Mösch 4c0f33782c Check disabled regions for all syntax types in parent rewriter class (#5292) 2023-10-23 15:34:51 -04:00
Danny Mösch 5ec1de0312 Generate makeRewriter optionally (#5281) 2023-10-17 15:19:19 -04:00
Danny Mösch 57632017e4 Introduce parent class for rewriters (#5282) 2023-10-17 18:55:02 +02: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 58928b7e40 Enforce any on existential types (#5273)
This makes syntactically clear which types are rather expensive.
2023-10-12 08:37:23 +02:00
Danny Mösch 6438c77b96 Harmonize rule extensions (#5272) 2023-10-11 19:39:38 +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 2433e7b5bf Make use of macros to generate configuration parsing code (#5250) 2023-10-02 22:35:24 +02:00
John Szumski 696e19df33 Fix false positives in unused_import rule for constructors defined in transitive modules (#5246) 2023-10-01 11:19:41 +02:00
Danny Mösch 68b27d8310 Inline conditional examples requiring Swift 5.9 (#5249) 2023-09-30 09:56:54 -04:00
John Szumski 8517e9c8b7 Preserve @_exported import statements in unused_imports (#5242) 2023-09-30 08:47:17 -04:00
Tatsuyuki Kobayashi 1bbce6c1b0 Add only configuration option to todo rule (#5233) 2023-09-26 14:45:04 -04:00
Danny Mösch 075017cba5 Merge modifier extensions into one (#5234) 2023-09-24 23:50:10 +02:00
Danny Mösch 35a78815d1 Update SwiftSyntax (#5198) 2023-09-14 22:49:55 +02:00
Tatsuyuki Kobayashi b609a4bebb Fix false positive in test_case_accessibility (#5212) 2023-09-08 10:12:55 -07:00
Martin Redington 8c68e80118 Check character before command in invalid_swiftlint_command rule (#5204) 2023-09-05 21:40:27 +02:00
Matt Thompson b54d957426 Let private_swiftui_state rule also apply to @StateObject (#5200) 2023-09-01 17:16:02 -04:00
Danny Mösch b281a8d33a Update SwiftSyntax (#5168) 2023-08-30 22:57:10 +02:00
Martin Redington f8225073cd Remove Image(systemName:) special case (#5175) 2023-08-30 18:08:40 +02:00