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
Only use public types in the signatures of exported formatter functions #463
Comments
For this particular case we have forwarded constants into public I think the idea of having most of implementation details under |
I'm having similar issues as @zachmandeville - implementing any decent formatter requires access to internal packages. IMHO the whole way that formatters are build needs a revamp. In the ideal world, one should be able to build any of the 'internal' formatters based just on the |
I agree, internal |
🤔 What's the problem you've observed?
When extending a formatter (like the example emoji formatter), you can use the
formatter.Storage
methods to get back resultsyou need. However, a lot of these methods have signatures that rely on internal types. This can make it difficult to use these public methods.
For example, if i have formatter
f
, that is extending thegodog.ProgressFmt
, then i have access to this function:With this, I can easily get all failed steps, all passed steps, etc....
Except this function takes as its parameter
models.StepResultStatus
, and I do not have access tomodels
. So if I want to get all passed steps, i have to know thatmodels.Passed
is roughly equivalent to0
and pass0
in directly.This may be me misunderstanding how this function is intended to be used, though.
✨ Do you have a proposal for making it better?
My naive suggestion is to move models out of the internal directory, or at least adjust any of the base formatter functions to only use public types in their signatures.
The text was updated successfully, but these errors were encountered: