Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite SyntacticSugarRule using SwiftSyntax #3866

Merged
merged 2 commits into from
Mar 23, 2022

Conversation

PaulTaykalo
Copy link
Collaborator

@PaulTaykalo PaulTaykalo commented Mar 2, 2022

This adds additional checks for syntactic_sugar rule

This fixes #3156

Changes

  • Optional.none will not be triggered (This was causing some unexpected case, that were braking the code)
  • Complex expression with .self suffix won't be triggered, like <Optional>.self (Previously, some simple cases were handled)

@PaulTaykalo PaulTaykalo self-assigned this Mar 2, 2022
@PaulTaykalo PaulTaykalo force-pushed the fix/critical-error-in-syntactic-sugar-rule branch 2 times, most recently from f7b6423 to 70d8963 Compare March 2, 2022 10:20
@PaulTaykalo PaulTaykalo requested a review from jpsim March 2, 2022 10:31
@jpsim
Copy link
Collaborator

jpsim commented Mar 2, 2022

Looks good to me, thanks for the fix. Is there a reason this PR is marked as a draft?

The Buildkite CI agent appears to be down, I’m looking into that now. I’d like to see the OSSCheck output before merging this.

@SwiftLintBot
Copy link

SwiftLintBot commented Mar 2, 2022

2 Warnings
⚠️ This PR may need tests.
⚠️ This PR introduced a violation in Sourcery: /SourceryTests/Stub/Performance-Code/Kiosk/App/Models/Artwork.swift:78:61: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [String: Int] instead of Dictionary<String, Int>. (syntactic_sugar)
71 Messages
📖 Linting Aerial with this PR took 0.98s vs 0.98s on master (0% slower)
📖 Linting Alamofire with this PR took 1.11s vs 1.11s on master (0% slower)
📖 Linting Firefox with this PR took 4.15s vs 4.13s on master (0% slower)
📖 Linting Kickstarter with this PR took 7.44s vs 7.4s on master (0% slower)
📖 Linting Moya with this PR took 4.38s vs 4.42s on master (0% faster)
📖 Linting Nimble with this PR took 0.4s vs 0.4s on master (0% slower)
📖 Linting Quick with this PR took 0.17s vs 0.17s on master (0% slower)
📖 Linting Realm with this PR took 10.12s vs 9.84s on master (2% slower)
📖 Linting SourceKitten with this PR took 0.33s vs 0.33s on master (0% slower)
📖 Linting Sourcery with this PR took 2.02s vs 2.02s on master (0% slower)
📖 Linting Swift with this PR took 3.14s vs 3.13s on master (0% slower)
📖 Linting WordPress with this PR took 7.41s vs 7.38s on master (0% slower)
📖 This PR fixed a violation in Realm: /RealmSwift/CustomPersistable.swift:171:67: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Realm: /RealmSwift/CustomPersistable.swift:208:67: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Realm: /RealmSwift/Impl/ComplexTypes.swift:294:67: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Realm: /RealmSwift/Impl/Persistable.swift:77:60: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Realm: /RealmSwift/Tests/ObjectSchemaInitializationTests.swift:313:20: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Realm: /RealmSwift/Tests/ObjectSchemaInitializationTests.swift:314:20: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Realm: /RealmSwift/Tests/ObjectSchemaInitializationTests.swift:315:20: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Realm: /RealmSwift/Tests/ObjectSchemaInitializationTests.swift:316:20: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Realm: /RealmSwift/Tests/ObjectSchemaInitializationTests.swift:317:20: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Realm: /RealmSwift/Tests/ObjectSchemaInitializationTests.swift:318:20: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Realm: /RealmSwift/Tests/ObjectSchemaInitializationTests.swift:319:20: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Realm: /RealmSwift/Tests/ObjectSchemaInitializationTests.swift:320:20: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Realm: /RealmSwift/Tests/ObjectSchemaInitializationTests.swift:321:20: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Realm: /RealmSwift/Tests/ObjectSchemaInitializationTests.swift:322:20: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Realm: /RealmSwift/Tests/ObjectSchemaInitializationTests.swift:323:20: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Realm: /RealmSwift/Tests/ObjectSchemaInitializationTests.swift:324:20: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Realm: /RealmSwift/Tests/ObjectSchemaInitializationTests.swift:325:20: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Realm: /RealmSwift/Tests/ObjectSchemaInitializationTests.swift:326:20: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/private/StdlibCollectionUnittest/CheckMutableCollectionType.swift:452:16: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/SwiftOnoneSupport/SwiftOnoneSupport.swift:314:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [Int] instead of Array<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Array.swift:300:15: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [Int] instead of Array<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/ArrayShared.swift:39:9: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [Int] instead of Array<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/BridgeObjectiveC.swift:703:34: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Dictionary.swift:389:15: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [String: Int] instead of Dictionary<String, Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/KeyPath.swift:1609:24: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/MigrationSupport.swift:158:18: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int! instead of ImplicitlyUnwrappedOptional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Optional.swift:122:13: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:101:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:102:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:103:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:106:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:11:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [Int] instead of Array<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:12:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [Int] instead of Array<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:15:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [Int] instead of Array<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:16:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [Int] instead of Array<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:19:25: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:22:24: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [String: Int] instead of Dictionary<String, Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:23:24: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [String: Int] instead of Dictionary<String, Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:26:24: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:27:24: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:31:28: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:34:27: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [String: Int] instead of Dictionary<String, Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:38:36: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:41:35: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [String: Int] instead of Dictionary<String, Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:55:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [String: Int] instead of Dictionary<String, Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:56:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [String: Int] instead of Dictionary<String, Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:59:28: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [Int] instead of Array<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:60:28: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [Int] instead of Array<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:61:28: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [Int] instead of Array<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:71:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:74:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:80:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:81:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:8:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. [Int] instead of Array<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:90:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:91:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:92:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:93:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)
📖 This PR fixed a violation in Swift: /stdlib/public/core/Prespecialize.swift:94:11: warning: Syntactic Sugar Violation: Shorthand syntactic sugar should be used, i.e. Int? instead of Optional<Int>. (syntactic_sugar)

Generated by 🚫 Danger

@jpsim
Copy link
Collaborator

jpsim commented Mar 2, 2022

@PaulTaykalo OSSCheck found some regressions, can you please audit and fix them?

@PaulTaykalo PaulTaykalo force-pushed the fix/critical-error-in-syntactic-sugar-rule branch 2 times, most recently from c49a844 to 19fd0b6 Compare March 2, 2022 20:13
@codecov-commenter
Copy link

codecov-commenter commented Mar 2, 2022

Codecov Report

Merging #3866 (1072c34) into master (702b36a) will decrease coverage by 0.06%.
The diff coverage is 86.78%.

@@            Coverage Diff             @@
##           master    #3866      +/-   ##
==========================================
- Coverage   92.61%   92.55%   -0.07%     
==========================================
  Files         436      437       +1     
  Lines       21964    22099     +135     
==========================================
+ Hits        20343    20453     +110     
- Misses       1621     1646      +25     
Impacted Files Coverage Δ
Source/SwiftLintFramework/Models/Example.swift 86.20% <20.00%> (-13.80%) ⬇️
Tests/SwiftLintFrameworkTests/TestHelpers.swift 79.08% <69.56%> (-0.80%) ⬇️
...Framework/Rules/Idiomatic/SyntacticSugarRule.swift 90.09% <90.15%> (+0.20%) ⬆️
...tFramework/Extensions/StringView+SwiftSyntax.swift 100.00% <100.00%> (ø)
Source/SwiftLintFramework/Models/Linter.swift 79.09% <0.00%> (-1.70%) ⬇️
...iftLintFramework/Extensions/String+SwiftLint.swift 89.39% <0.00%> (-1.52%) ⬇️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@PaulTaykalo PaulTaykalo force-pushed the fix/critical-error-in-syntactic-sugar-rule branch from 19fd0b6 to df3dde4 Compare March 2, 2022 20:36
@jpsim
Copy link
Collaborator

jpsim commented Mar 2, 2022

OSSCheck found some regressions, can you please audit and fix them?

Thanks, there's fewer regressions now but still 4 remaining.

@PaulTaykalo PaulTaykalo force-pushed the fix/critical-error-in-syntactic-sugar-rule branch from df3dde4 to 19b2b76 Compare March 10, 2022 15:49
@jpsim
Copy link
Collaborator

jpsim commented Mar 10, 2022

I'm wondering if this would be easier to write using SwiftSyntax 🤔

@PaulTaykalo PaulTaykalo force-pushed the fix/critical-error-in-syntactic-sugar-rule branch 2 times, most recently from f14a46c to 5be51c6 Compare March 10, 2022 16:16
@PaulTaykalo
Copy link
Collaborator Author

@jpsim 🤔

@jpsim
Copy link
Collaborator

jpsim commented Mar 10, 2022

I recently re-added support for SwiftSyntax-based rules (e.g. #3867) and I'm wondering if it would be easier to write this rule if we used a Swift Syntax visitor rather than these challenging regular expressions.

@PaulTaykalo
Copy link
Collaborator Author

@jpsim yeah, I understood, what do you mean. I would like to try, but, first will fix this PR and then will try to use Swiftsyntax :)

@jpsim
Copy link
Collaborator

jpsim commented Mar 10, 2022

ok I don't want to cause more work for you, I was just suggesting an alternative if making this work with regular expressions is too hard.

@PaulTaykalo
Copy link
Collaborator Author

Well, in the general case, this kind of task is unresolvable using regular expressions. so this should fix most of the cases. but I'll check whether it is possible to use SwiftSyntax here

@PaulTaykalo
Copy link
Collaborator Author

Oh, this is slow :)
image

@PaulTaykalo PaulTaykalo changed the title Fix syntactic sugar autocorrect rule Fix syntactic sugar autocorrect rule, rewrite rule using SwiftSyntax Mar 11, 2022
@PaulTaykalo PaulTaykalo marked this pull request as draft March 11, 2022 04:47
@PaulTaykalo
Copy link
Collaborator Author

@jpsim after few hours of debugging, decided, that it is probably, will be a better idea to use SwiftSyntax

@PaulTaykalo PaulTaykalo force-pushed the fix/critical-error-in-syntactic-sugar-rule branch 2 times, most recently from 9150974 to 3c79fa7 Compare March 11, 2022 05:44
@jpsim
Copy link
Collaborator

jpsim commented Mar 11, 2022

Great progress on this. Let me know if you'd like a hand at any point.

@PaulTaykalo
Copy link
Collaborator Author

@jpsim committing between air alerts :)

@jpsim
Copy link
Collaborator

jpsim commented Mar 11, 2022

committing between air alerts :)

omg please stay safe ❤️

@PaulTaykalo
Copy link
Collaborator Author

PaulTaykalo commented Mar 11, 2022

omg please stay safe ❤️

👍🏼 It's relatively safe here.

@jpsim have a question regarding triggering/non-triggering examples.

I added these as "non-triggering". are these examples fine?

            Example("var currentIndex: Array<OnboardingPage>.Index?"),
            Example("func x(a: [Int], b: Int) -> Array<Int>.Index"),
            Example("unsafeBitCast(nonOptionalT, to: Optional<T>.self)"),
            Example("unsafeBitCast(someType, to: Swift.Array<T>.self)"),
            Example("let a = Swift.Optional<String?>.none"),

// These were marked as "triggering" in previous variant
            Example("let x = Array<String>.array(of: object)"),
            Example("let x = Swift.Array<String>.array(of: object)"),

@jpsim
Copy link
Collaborator

jpsim commented Mar 11, 2022

I added these as "non-triggering". are these examples fine?

Those look perfectly fine to me.

@PaulTaykalo
Copy link
Collaborator Author

Ok then, will move on to corrections :)

@jpsim
Copy link
Collaborator

jpsim commented Mar 11, 2022

Sorry for the trouble, but you may need to rebase to get #3893 for Danger/OSSCheck to run on your next commit.

@PaulTaykalo PaulTaykalo force-pushed the fix/critical-error-in-syntactic-sugar-rule branch from d953b59 to 1cd8847 Compare March 11, 2022 21:56
@PaulTaykalo PaulTaykalo force-pushed the fix/critical-error-in-syntactic-sugar-rule branch 3 times, most recently from b816f92 to ecbfd23 Compare March 20, 2022 16:24
@PaulTaykalo
Copy link
Collaborator Author

@jpsim can you look at it?

In general there are two cases which changed:

  • Optional<T>.none will not be triggered
  • Complex expression with .self suffix won't be triggered, like <Optional<Array>>.self

@PaulTaykalo PaulTaykalo force-pushed the fix/critical-error-in-syntactic-sugar-rule branch 3 times, most recently from ba4e1bf to 4f3ed70 Compare March 21, 2022 02:09
@PaulTaykalo PaulTaykalo force-pushed the fix/critical-error-in-syntactic-sugar-rule branch from 4f3ed70 to 65093fe Compare March 21, 2022 02:10
@PaulTaykalo PaulTaykalo changed the title Fix syntactic sugar autocorrect rule, rewrite rule using SwiftSyntax Rewrite SyntacticSugarRule using SwiftSyntax Mar 21, 2022
@PaulTaykalo PaulTaykalo marked this pull request as ready for review March 22, 2022 10:34
@PaulTaykalo PaulTaykalo merged commit d756541 into master Mar 23, 2022
@PaulTaykalo PaulTaykalo deleted the fix/critical-error-in-syntactic-sugar-rule branch March 23, 2022 16:30
@jpsim
Copy link
Collaborator

jpsim commented Mar 23, 2022

Great job here! Sorry I didn't review faster, but I'd like to suggest a few minor changes in #3915. Please review if you get a chance.

coffmark pushed a commit to coffmark/SwiftLint that referenced this pull request Apr 11, 2022
Rewrite SyntacticSugarRule with SwiftSyntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Critical error in autocorrect for syntactic_sugar
4 participants