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

feat: add swoosh module #149

Merged
merged 4 commits into from
Nov 12, 2024
Merged

feat: add swoosh module #149

merged 4 commits into from
Nov 12, 2024

Conversation

barnabasJ
Copy link
Contributor

@barnabasJ barnabasJ self-assigned this Nov 12, 2024
@barnabasJ barnabasJ added the enhancement New feature or request label Nov 12, 2024
@barnabasJ barnabasJ requested a review from jimsynz November 12, 2024 13:55
lib/igniter/libs/swoosh.ex Outdated Show resolved Hide resolved
@doc "Moves to the use statement in a module that matches `use Swoosh.Mailer`"
@spec move_to_mailer_use(Igniter.t(), Sourceror.Zipper.t()) ::
:error | {:ok, Sourceror.Zipper.t()}
def move_to_mailer_use(_igniter, zipper) do
Copy link
Collaborator

Choose a reason for hiding this comment

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

I have mixed feelings on requiring an unused argument here.

It's consistent in that all the functions in Libs.Phoenix and Libs.Ecto require it, but all those functions actually use the argument. Maybe this function starts using it in the future in order to be more intelligent or efficient, but I somewhat doubt it.

We should probably either:

  1. Remove the argument and make it move_to_mailer_use/1, or
  2. Change the signature to move_to_mailer_use(%Igniter{}, zipper) to at least ensure the right thing is being passed in, even if it's not being used.

I think 1. is preferable (we can always deprecate it later), but I could be convinced of 2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm fine with 1. I just copied over some of the code from the phoenix module last week and made it work.
I should have taken another look at it today before pushing.

@barnabasJ barnabasJ merged commit e958bdd into main Nov 12, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants