Commit Graph

3513 Commits

Author SHA1 Message Date
Marcelo Fabri a0caceb16f Avoid withoutTrivia() where it’s not necessary 2023-02-07 02:56:41 -08:00
Marcelo Fabri 7eb479d546
Rewrite MultilineArgumentsRule using SwiftSyntax (#4750)
* Rewrite MultilineArgumentsRule using SwiftSyntax

* Add examples and changelog

Fixes #3399, #3605
2023-02-07 02:55:21 -08:00
Danny Mösch aafc574e90
Allow to pass a rule identifier to the `swiftlint docs` command (#4710) 2023-02-07 00:01:52 +01:00
Danny Mösch 5af4291b53
Let Emoji reporter print rule identifier (#4708) 2023-02-06 16:28:07 -05:00
Danny Mösch d3ebfc5567
Let `number_separator` rule trigger on misplaced separators (#4685) 2023-02-06 16:22:31 -05:00
Marcelo Fabri 60d0dd8a05
Update SwiftSyntaxRule.swift (#4749) 2023-02-06 14:16:18 -05:00
Marcelo Fabri 0163ffd328
Cache folded syntax tree (#4744) 2023-02-06 10:39:36 -08:00
Marcelo Fabri aba0f63704
Speed up class_delegate_protocol rule (#4743) 2023-02-05 18:45:24 -08:00
Danny Mösch 325d0ee1e4
Consider custom attributes in `attributes` rule (#4616) 2023-01-31 22:34:11 +01:00
Danny Mösch 5eed8fe91b
Enable `if_let_shadowing` rule and fix all violations (#4247) 2023-01-31 22:31:38 +01:00
Danny Mösch 0796236031
Use text blocks in reporters if reasonable (#4733) 2023-01-30 16:38:07 -05:00
Patrick 651b00eb70
Updated JUnit reporter (#4725) 2023-01-30 20:48:29 +01:00
Danny Mösch 500f143c7d
Remove unused code (#4729) 2023-01-28 19:50:22 +01:00
JP Simard 0750d5d465
Extract `EnumDeclSyntax.supportsRawValues` helper (#4727)
I'll want to use this elsewhere shortly.

Also adds `CGFloat` to the raw value types since we were missing that
one.
2023-01-27 16:46:54 -05:00
JP Simard 84c6d200b6
Clean up unused initializers (#4726)
Found with the upcoming improve dead code detection.
2023-01-27 16:31:56 -05:00
JP Simard dc228d57ac
Update dependencies (#4702) 2023-01-17 12:59:32 -05:00
Danny Mösch 82249f5ed4
Include recently added option into rule/cache description (#4688) 2023-01-13 17:37:29 -05:00
Danny Mösch 78c9ad6f33
Rephrase rule description (#4686)
"Can't" sounds too hard. The Swift compiler allows multiple enum cases with the same name. It's rather a recommendation.
2023-01-12 18:06:04 +01:00
Danny Mösch 693e504258
Use basic NSRegularExpression type with caching (#4683) 2023-01-11 20:28:16 +01:00
Danny Mösch b66dd13e2f
Ensure negative literals in initializers don't trigger `no_magic_numbers` (#4679) 2023-01-11 00:09:53 +01:00
kyounh12 5ec6112ba1
Interpret strings in `excluded` option of `*_name` rules as regex (#4655) 2023-01-10 23:29:04 +01:00
Danny Mösch 74dbd52add Fix/improve some rule descriptions 2023-01-10 22:29:13 +01:00
Danny Mösch cc44c989b7 Check every used internal violation reason for a pending period 2023-01-10 22:29:13 +01:00
Danny Mösch e64e82d80d Get rid of periods finishing rule descriptions 2023-01-10 22:29:13 +01:00
Danny Mösch 672e19651f Use configuration raw name expected when reading the configuration 2023-01-08 15:05:43 +01:00
Danny Mösch 67eb330f1c Add key to severity configuration as a hint for the correct YAML syntax 2023-01-08 15:05:43 +01:00
github-actions[bot] bcfc2c4b6c
Update SwiftSyntax (#4673)
* Exclude `Documentation.docc` when building SwiftSyntax
* Remove references to `.stringInterpolationAnchor`

Co-authored-by: JP Simard <jp@jpsim.com>
2023-01-06 11:12:17 -05:00
Ethan Wong 68dc0f58d2
List Analyzer rules in an independent section in the rule directory (#4664) 2023-01-03 07:18:25 +01:00
Danny Mösch d6ff2a7f37
Rewrite `explicit_type_interface` rule with SwiftSyntax fixing a false-positive (#4638) 2023-01-01 23:23:50 +01:00
Danny Mösch 64d9619a8a
Report violations in all `<scope>_length` rules when error < warning threshold (#4647) 2023-01-01 23:15:36 +01:00
Danny Mösch 5ff40867b3
Apply consistent capitalization to rule names (#3938) 2022-12-26 09:32:36 +01:00
Martin Redington 58611e6718
Ignore compiler directives in `opening_brace` rule (#4658) 2022-12-25 18:46:16 +01:00
Danny Mösch c740da48d5
Deprecate `inert_defer` rule in favor of the Swift compiler warning (#4618) 2022-12-23 04:07:41 -05:00
Jimmy Arts eda0d92f44
Make forceExclude work with directly specified files (#4609) 2022-12-22 21:15:08 +01:00
Benedek Kozma d76daf5f62
Deprecate `unused_capture_list` rule in favor of the Swift compiler warning (#4656) 2022-12-22 10:33:44 -05:00
Marcelo Fabri 7bd8362dae
Fix false positive on `private_subject` (#4646)
Fixes #4643
2022-12-19 13:31:34 -03:00
David Steinacher 540003e2a1
Add support for new Quick APIs `aroundEach` and `justBeforeEach` (#4627) 2022-12-15 23:29:02 +01:00
Julio Carrettoni 3745704c03
Add rule for single space after period on comments (#4624) 2022-12-15 23:27:33 +01:00
github-actions[bot] 25c3fb161d
Update SwiftSyntax (#4639)
* `ObjcKeyPathExprSyntax` -> `MacroExpansionExprSyntax`
* Fix `#selector()` and add a regression test

Co-authored-by: JP Simard <jp@jpsim.com>
2022-12-14 10:52:47 -05:00
JP Simard a876e860ee
release 0.50.3 2022-12-09 14:12:02 -05:00
JP Simard ff06e0ed00
release 0.50.2 2022-12-09 13:49:24 -05:00
JP Simard 73a64d674c
Fix rewrite issue with `comma` rule (#4635) 2022-12-09 12:56:50 -05:00
Danny Mösch 609418f702
Skip `defer` statements in `#if` block if it is not itself the last statement (#4617) 2022-12-06 02:22:03 -05:00
Danny Mösch 4adabd8e4b
Print a warning for Analyzer rules misplaced in the configuration (#4620) 2022-12-05 18:03:54 -05:00
Danny Mösch 93d0d8fa7f
Fix configuration parsing error in `unused_declaration` rule (#4619) 2022-12-05 23:11:19 +01:00
JP Simard 95d56e4130
Use `raw` in SwiftSyntaxBuilder string interpolation (#4623)
Fixing build warnings to account for
https://github.com/apple/swift-syntax/pull/1090.
2022-12-05 11:26:04 -05:00
Marcelo Fabri 60128ab196
Don’t trigger shorthand_operator inside operator declaration (#4613)
Fixes #4611
2022-12-02 02:00:44 -05:00
Martin Redington 7a8b2d1dab
Add `test_parent_class` option to more test rules (#4262) 2022-12-01 18:56:13 +01:00
Ryan Aveo 92304cdd98
Fix building tests in Xcode (#4607)
Co-authored-by: JP Simard <jp@jpsim.com>
2022-11-30 10:33:33 -05:00
Steffen Matthischke 97ba82d740
Fix empty_enum_arguments false positive when called expression is an identifier (#4600) 2022-11-28 17:20:34 -05:00