Closed GregMefford closed 6 years ago
I also put in a commit to set the formatter line_length
to 120
because the default of 80
isn't very wide and makes some lines split in annoying ways. I'm fine if you don't want to change that, though.
Should pull in the newest Dialyxir RC while you're here to get the new Elixir formatting =)
@asummers lets do a separate PR with that. Feel free to, or to lodge an issue for me to do it :)
This looks great! Left some feedback/discussion.
Hadn't heard about that @asummers, but now I want to look into that! 😁
The testing looks awesome. I'm very surprised to hear the opts with invalid types are ignored. If that's true, it's 100% a bug that we should fix. I still have a slight issue with Span.new I think. When I'm at my laptop I'll post an alternative. Aside from that, and the issue w/ validation, I think this should be good to go.
We should diagnose the validation issue at least, and then maybe fix it in a separate PR.
Ah, I see the issue. The validator is doing the right thing, but we always return the span, even if we didn't update it. I think that, as part of this return type refactor, we would expect to return the errors.
Thinking about it now, there are certain functions where that would be hard (like update_all_spans
). I think that, for now, we should leave the tests you've added in place, but have them skipped. I will add a ticket now to investigate replacing the usage of update_or_keep
with something that would provide more meaningful returns. We will probably just have to have update_all_spans
always return a success, or not update anything in the case that any of them are an error. Either way, probably should not address here.
Alright, @GregMefford since we know whats up with the validation issue the only thing left is Span.new/2
. This PR https://github.com/spandex-project/spandex/pull/66 proposes changes to this branch to address my concerns. Once we're done with that, we should be good to go.
Ok, I think this is all set. ✅
When running
mix dialyzer
, I was getting the following errors:Those are now resolved, but when I started to tug on that thread, the changes ended up leading me all over the place and I'm sorry for the huge PR.
As mentioned in #62, this also standardizes on
{:ok, result}
tuples wherever an{:error, reason}
tuple is possible. For that reason, I'm proposing a version bump from2.0.0
to2.1.0
since it's a small breaking change to the API, but my guess is that people probably aren't often using the return values from these functions in practice, as long as the right things are getting passed around inside Spandex.