Commit Graph

2264 Commits

Author SHA1 Message Date
JP Simard 0808f2508b Fix typo in example (#4222) 2022-09-19 15:51:21 -04:00
JP Simard 8d500d1a63 Rewrite empty_collection_literal with SwiftSyntax (#4220) 2022-09-19 12:39:35 +02:00
JP Simard 992cc9afe3 Rewrite discouraged_object_literal with SwiftSyntax (#4219) 2022-09-19 10:24:22 +00:00
Danny Mösch 38e71f7a10 Enhance docs for type_name rule (#4197) 2022-09-10 10:54:13 -04:00
tillhainbach a9ec894caf Add exceptions to weak_delegate rule (#3599) 2022-09-10 10:07:43 -04:00
Chris Brakebill 9db303e3a3 Respect 'validates_start_with_lowercase' for function names in identifier_name rule (#4188) 2022-09-09 23:36:55 +02:00
JP Simard 4b1bb38fc3 Include the configured bind_identifier in self_binding violation (#4196)
As suggested in https://github.com/realm/SwiftLint/pull/4146#issuecomment-1241793057
2022-09-09 16:08:26 +00:00
Marcelo Fabri baf5647e2b Rewrite multiple_closures_with_trailing_closure with SwiftSyntax (#4193) 2022-09-08 19:34:06 +02:00
JP Simard 837f46479f Rewrite toggle_bool with SwiftSyntax (#4190) 2022-09-08 05:27:44 +00:00
JP Simard c6f3d0a6af Rewrite xctfail_message with SwiftSyntax (#4189) 2022-09-08 00:03:44 -04:00
Danny Mösch 6b393b1b53 Re-delegate to ArrayInitRule (#4185) 2022-09-07 21:14:45 +00:00
JP Simard 4234664671 Rewrite anyobject_protocol with SwiftSyntax & deprecate (#4170) 2022-09-07 19:40:34 +00:00
JP Simard 8cd025112d Rewrite block_based_kvo with SwiftSyntax (#4171) 2022-09-07 15:16:22 -04:00
JP Simard efbe4d9f0f Rewrite discouraged_optional_boolean with SwiftSyntax (#4179) 2022-09-07 15:15:38 -04:00
JP Simard 4a239a695e Rewrite array_init rule with SwiftSyntax (#4175) 2022-09-07 15:15:10 -04:00
JP Simard bc7792ecd6 Rewrite empty_string with SwiftSyntax (#4177) 2022-09-07 13:59:15 -04:00
JP Simard 958cc20a9f Rewrite redundant_nil_coalescing with SwiftSyntax (#4182) 2022-09-07 13:29:06 -04:00
JP Simard 117ef7f0e2 Rewrite flatmap_over_map_reduce with SwiftSyntax (#4178) 2022-09-07 13:23:51 -04:00
JP Simard 0d03221281 Rewrite class_delegate_protocol with SwiftSyntax (#4172) 2022-09-07 12:20:47 -04:00
JP Simard 80c8e5d37a Rewrite closing_brace with SwiftSyntax (#4173) 2022-09-07 12:20:26 -04:00
JP Simard 9060d3f8e8 Rewrite force_try with SwiftSyntax (#4181) 2022-09-07 11:18:01 -04:00
JP Simard eb30be3826 Add SourceKitFreeRule conformance to FileNameNoSpaceRule (#4180) 2022-09-07 10:36:57 -04:00
JP Simard 2a8d536857 Remove delegation of TypesafeArrayInitRule to ArrayInitRule (#4174)
In preparation for rewriting `ArrayInitRule` with SwiftSyntax.
2022-09-07 01:34:58 -04:00
Ryan Cole c34955ca64 Add accessibility_trait_for_button rule (#3989) 2022-09-06 21:44:09 +00:00
Danny Mösch e459c4ae9b Exclude weak_delegate rule from autocorrection (#4153) 2022-09-06 22:56:51 +02:00
Marcelo Fabri e2900c4a7e Rewrite untyped_error_in_catch with SwiftSyntax (#4163) 2022-09-06 09:25:06 -07:00
Marcelo Fabri dd94d4ec53 Rewrite computed_accessors_order with SwiftSyntax (#4165) 2022-09-06 09:24:54 -07:00
Marcelo Fabri 1e7e0d6301 Remove references to ImplicitlyUnwrappedOptional type (#4166) 2022-09-06 09:01:22 -07:00
JP Simard 4b8a68072b Call super.visit in SyntaxRewriter overrides (#4167)
As discussed in https://github.com/realm/SwiftLint/pull/4159#discussion_r962841482
2022-09-06 13:52:40 +00:00
JP Simard 26465f21ce Add methods from SE-0348 to UnusedDeclarationRule (#4168)
https://github.com/apple/swift-evolution/blob/main/proposals/0348-buildpartialblock.md
2022-09-06 09:45:34 -04:00
Marcelo Fabri 622d48bd0a Convert unneeded_break_in_switch to SwiftSyntax (#4164) 2022-09-05 20:32:29 -07:00
Marcelo Fabri b9e6a9aed8 Rewrite unneeded_parentheses_in_closure_argument with SwiftSyntax (#4159) 2022-09-05 06:12:33 -04:00
Marcelo Fabri 6c0413077c Rewrite unowned_variable_capture with SwiftSyntax (#4161) 2022-09-05 05:38:29 -04:00
Marcelo Fabri c7c4e0a1f3 Rewrite implicit_getter rule with SwiftSyntax (#4160)
* Rewrite `implicit_getter` rule with SwiftSyntax

* Handle different reason messages

* Add changelog + implicit return
2022-09-05 01:28:25 -04:00
Marcelo Fabri ca2d3a874f Rewrite large_tuple rule with SwiftSyntax (#4156)
* Rewrite `large_tuple` rule with SwiftSyntax

* Add changelog, remove import

* Update Source/SwiftLintFramework/Rules/Metrics/LargeTupleRule.swift

Co-authored-by: JP Simard <jp@jpsim.com>

Co-authored-by: JP Simard <jp@jpsim.com>
2022-09-05 01:10:59 -04:00
Marcelo Fabri 79347a1728 Rewrite ForceUnwrappingRule using SwiftSyntax (#4155) 2022-09-04 02:08:26 -07:00
Marcelo Fabri c1650e6918 Add excludes_trivial_init for `missing_docs (#4152)
Fixes #4107
2022-09-03 22:11:57 -07:00
JP Simard 9979c4fd27 Add new self_binding opt-in rule (#4146)
To enforce that `self` identifiers are consistently re-bound to a common
identifier name.

Configure `bind_identifier` to the name you want to use.

Defaults to `self`.

Addresses https://github.com/realm/SwiftLint/issues/2495
2022-08-30 16:37:19 -04:00
Martin Hosna f32bc1f337 RedundantDiscardableLetRule should not produce warning when used with async (#4143)
handle situation with async let _ = ....
let can not be removed from "async let _ = ..." because removing it produces invalid swift syntax

Co-authored-by: Martin Hosna <mhosna@samepage.io>
2022-08-29 12:56:35 -04:00
JP Simard cd9bd5f9fd Make duplicate_imports rule documentation deterministic (#4137) 2022-08-28 18:27:12 -04:00
Danny Mösch bf9bf83143 Migrate EmptyXCTestMethodRule to SwiftSyntax fixing some false-positives (#4129) 2022-08-27 03:02:05 -04: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
Ben Davis 7dfadc205a Add new configuration to operator_usage_whitespace rule to specify no-space operators (#4112) 2022-08-25 17:59:27 +02:00
Danny Mösch f3e2c0b7bb Replace manual backtracking by location information from the captured group (#4111) 2022-08-19 20:14:19 +02:00
Danny Mösch 6dc2ef937e Add trigger markers to examples (#4110) 2022-08-18 22:15:11 +00:00
Kotaro Suto 78949c1b99 Fix broken correction for explicit_init rule (#4109) 2022-08-18 17:17:52 +00:00
chrisjf 1ef15f3bb7 Update documentation for multiline_arguments_brackets and multiline_literal_brackets (#4098)
- added two triggering examples that are a common style, to make it immediately obvious that they trigger the rules
- also fixed a spelling mistake throughout the examples for the multiline_literal_brackets rule ("Gryffindor" is now correctly spelt)
2022-08-18 09:53:52 +02:00
Kotaro Suto 3aa249b8a1 Fix first_where false negative (#4105) 2022-08-17 00:06:32 +00:00
JP Simard ac23f2e89a Log time spent in each custom rule (#4100) 2022-08-15 22:03:06 -04:00
JP Simard 13703c4466 Update SourceKitFreeRules (#4097)
None of these rules use SourceKit
2022-08-16 00:56:03 +00:00