Skip to content

Conversation

dfed
Copy link
Owner

@dfed dfed commented Jun 1, 2025

When an @Instantiable does not have a properly formatted init, and one of the type's init methods only is missing arguments or has incorrect/missing accessibility modifiers, our FixIt now updates an existing init method rather than creating a new one.

@dfed dfed self-assigned this Jun 1, 2025
Copy link

codecov bot commented Jun 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.91%. Comparing base (40e5b9f) to head (373e4b3).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             main     #164    +/-   ##
========================================
  Coverage   99.91%   99.91%            
========================================
  Files          32       32            
  Lines        3461     3699   +238     
========================================
+ Hits         3458     3696   +238     
  Misses          3        3            
Files with missing lines Coverage Δ
...s/SafeDICore/Errors/FixableInstantiableError.swift 100.00% <100.00%> (ø)
Sources/SafeDICore/Models/Initializer.swift 100.00% <100.00%> (ø)
Sources/SafeDICore/Models/Property.swift 100.00% <100.00%> (ø)
...rces/SafeDICore/Visitors/InstantiableVisitor.swift 100.00% <100.00%> (ø)
...ources/SafeDIMacros/Macros/InstantiableMacro.swift 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dfed dfed force-pushed the dfed--fixit-init branch from fe8e7dc to c432a02 Compare June 1, 2025 19:45
@dfed dfed marked this pull request as ready for review June 1, 2025 20:04
Copy link
Collaborator

@NickEntin NickEntin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests LGTM

self.receivedA = receivedA
receivedB = ReceivedB()
}
init(forwardedA: ForwardedA, receivedA: ReceivedA, receivedB: ReceivedB, customizable: String = "") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it also add public here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess will just do two passes on fix-its right now

Copy link
Owner Author

@dfed dfed Jun 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally yes, but today we just do one fix at a time. There will be new fixit once the first fixit is applied.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you beat me to it 😉

@dfed dfed merged commit 2f9faf3 into main Jun 2, 2025
20 checks passed
@dfed dfed deleted the dfed--fixit-init branch June 2, 2025 00:02
dfed added a commit that referenced this pull request Jun 29, 2025
#164 introduced an issue where a fixit to add new parameters to an
initializer would repeat any closure parameters in the list. This PR
addresses that issue.
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.

2 participants