Commit Graph

203 Commits

Author SHA1 Message Date
Danny Mösch b42f6ffe77 Keep initializers with attributed parameters in unneeded_synthesized_initializer rule (#5594) 2024-05-17 23:06:09 +02:00
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 161391de27 Treat conditional code as if it was always active (#5581) 2024-05-16 16:48:47 +00:00
Danny Mösch 03af3167fb Fix wording of static_over_final_class rule's violation message (#5583) 2024-05-15 21:42:47 +00:00
Danny Mösch dfe19ac7fc Respect comments before opening braces in opening_brace rule (#5582) 2024-05-15 23:06:59 +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 e84a6fc6b2 Silence unused_enumerated rule when $0 in a closure is explicitly unpacked (#5577) 2024-05-15 19:41:55 +02: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
Danny Mösch 11cbac63d1 Enable consider_default_literal_types_redundant option (#5555) 2024-05-01 19:58:42 +00:00
Danny Mösch 1658f1de70 Extract method for common code and make signatures swiftier (#5554) 2024-05-01 19:48:13 +00:00
Garric G. Nahapetian 16c0213027 Add option to redundant_type_annotation rule to consider default literal types redundant (#4756) 2024-05-01 21:15:35 +02:00
Martin Redington 7623f1e730 Enable more rules in SwiftLint's own .swiftlint.yml (#5532) 2024-04-27 18:43:08 +02:00
Danny Mösch 1b7fbc4bcd Make postprocessors non-throwing (#5539)
Failing immediately when a property is invalid is too strict. It feels
sufficient to allow to report an issue but otherwise continue with a default
value instead of stopping execution completely.
2024-04-23 16:45:59 -04:00
Danny Mösch 3276266716 Respect nested types in redundant_type_annotation rule (#5537) 2024-04-21 19:15:01 +00:00
Danny Mösch e643f210c5 Respect array types in redundant_type_annotation rule (#5536) 2024-04-21 17:39:54 +00:00
Marceau TONELLI b3dd89088e Rewrite redundant_type_annotation with SwiftSyntax (#5389)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2024-04-21 17:46:29 +02:00
Martin Redington 2d4f0bc85a Extend unused_enumerated rule to chained calls with closures (#5498) 2024-04-13 10:33:36 +02:00
Martin Redington dd8789b530 Update blanket_disable_command rule reason and description (#5518) 2024-04-04 16:25:06 +00:00
Danny Mösch ccd50e8c68 Merge duplicated issues 2024-03-24 09:36:18 +01:00
Danny Mösch 82cad0bfff Allow to infer option names (#5505)
This allows to infer names of options from their names in a configuration. CamelCase is translated into snake_case automatically when `apply` is triggered.

* Don't have all `RuleConfiguration`s conform to `InlinableOptionType`. Mark types that must have this capability explicitly. Same for `AcceptableByConfigurationElement`.
* A type being an `InlinableOptionType` doesn't mean it's automatically inlined. This also doesn't depend on the fact of having a name for its key configured any longer. Instead, an `inline` attribute must explicitly be set to `true` in `@ConfigurationElement`.
* Key name inference is optional and can be overwritten by specifying a key name in the attribute.
* Inlined configurations only fail in `apply` when they are really sure that something is odd. Otherwise, they accept to not being updated.
2024-03-23 18:54:39 +01: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 e0b6a54f6b Support private_over_fileprivate rule for actors (#5490) 2024-03-08 23:37:13 +01:00
Phlippie a84d9a9ed4 Add new static_over_final_class rule (#5487) 2024-03-08 20:37:35 +01:00
Kotaro Suto d9c6888287 Make trailing_closure rule correctable (#5453) 2024-03-05 21:16:45 +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
Marcelo Fabri f3fb17268c Rewrite extension_access_modifier rule with SwiftSyntax (#5310)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2024-02-09 23:03:45 +01:00
Hayashi Tatsuya 6d38558bd4 Rewrite nesting rule with SwiftSyntax (#5439) 2024-02-07 15:35:38 -05:00
Danny Mösch 7c29ae4f3e Add new shorthand_argument rule (#5451) 2024-02-06 23:36:28 +00:00
Danny Mösch f5cc749a5f Change violation position to declaration keyword (#5459) 2024-02-07 00:18:04 +01:00
Kotaro Suto f0c1780b53 Make empty_count rule correctable (#5409) 2024-01-29 20:15:51 +01:00
Kasra Babaei 77bae5429c Allow line_length rule to ignore certain lines based on regex patterns (#5437) 2024-01-26 09:40:59 +01:00
m.a 443cbd7fce Add new option ignore_typealiases_and_associatedtypes to nesting rule (#5433) 2024-01-21 12:28:23 -05:00
Hayashi Tatsuya 2be8846ad3 Rewrite orphaned_doc_comment rule with SwiftSyntax (#5417) 2024-01-21 09:20:12 +01:00
Danny Mösch 1e9428a92e Respect scattered disable commands in duplicate_imports rule (#5432) 2024-01-20 14:30:46 +01:00
Danny Mösch 7f960d345e Stop triggering no_magic_numbers rule on literals used in ranges (#5431) 2024-01-20 11:37:57 +01:00
Blake Kaplan 2b6e0ee9a8 Do not trigger return_value_from_void_function in initializers (#5429) 2024-01-19 14:42:44 -05:00
Danny Mösch 6bb9944050 Support continue, break and throw in superfluous_else rule (#5425) 2024-01-17 21:05:57 +01:00
Danny Mösch c1a422bfa1 Rename variables referring to if statements (#5423) 2024-01-16 18:49:29 +00:00
Danny Mösch 2057d607b7 Refine violation positions of superfluous_else rule (#5420) 2024-01-16 19:33:43 +01:00
Danny Mösch 1c605a597a Refine violation position of trailing_closure rule (#5419) 2024-01-16 13:16:04 -05:00
Kotaro Suto 6af9419e09 Rewrite trailing_closure rule with SwiftSyntax (#5414) 2024-01-15 10:10:03 +01:00
Hayashi Tatsuya 2f15f66fca Rewrite mark rule using SwiftSyntax (#5408) 2024-01-09 22:44:47 +01:00
Oleg Kohtenko f4fa852752 Compare case-insensitively in sorted_enum_cases rule (#5405) 2024-01-09 22:25:54 +01:00
Danny Mösch 31eb218b08 Rewrite if expressions also in other code blocks (#5413) 2024-01-07 14:32:44 -05:00