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

How to get the report formatting presented in the README #167

Open
lpil opened this issue Dec 5, 2023 · 8 comments
Open

How to get the report formatting presented in the README #167

lpil opened this issue Dec 5, 2023 · 8 comments

Comments

@lpil
Copy link
Contributor

lpil commented Dec 5, 2023

Hello!

The README documents error printing that is much more readable than the output from DefaultStringReporter. How does one get this output? I have been unable to find it.

Thank you

@mpizenberg
Copy link
Member

mpizenberg commented Dec 5, 2023

Hi @lpil

The readme error is an extract from the original pubgrub blog post, so it's an aspirational capability. The current published pubgrub would need you to rewrite the reporter.

HOWEVER, I'd suggest you look instead at the work currently done by @zanieb and @Eh2406 that enables much easier and better error customization. #156 and #158 already made their way into the dev branch, and #163 is on its way.

@lpil
Copy link
Contributor Author

lpil commented Dec 5, 2023

Ok! Thank you for the info. Looking forward to the next release 💜

@Eh2406
Copy link
Member

Eh2406 commented Dec 5, 2023

If you are interested in the quality of our error reports please come help with the work!

@lpil
Copy link
Contributor Author

lpil commented Dec 5, 2023

I'd love to, but I'm rather swamped with Gleam development at the moment 😁

@Eh2406
Copy link
Member

Eh2406 commented Dec 5, 2023

That is entirely reasonable. I hope you will pass along reproducible examples of bad error messages for us to work on, when you have time.

@Eh2406
Copy link
Member

Eh2406 commented Dec 5, 2023

Also, I would love to have a benchmark file based on your registry/ecosystem. (Like how we currently benchmark using all packages available in the Elm ecosystem.) Is your ecosystem, and the code interact with it, available?

@lpil
Copy link
Contributor Author

lpil commented Dec 6, 2023

It is! https://github.com/gleam-lang/gleam/blob/c4b02e686a78cf4280a9295ee06f8aa77cf2e2c2/compiler-core/src/dependency.rs#L22-L58

If you detail a little of what you're after I can add an issue to the Gleam tracker and someone may pick that up.

@mpizenberg
Copy link
Member

Something that would be super helpful for building an example dataset is a script that gathers all packages and versions existing and record them into a ron file. Or a subset if that's too big.

Here is an example (old) script where I did this for elm packages: https://github.com/mpizenberg/elm-solve-deps/blob/master/elm-solve-deps-lib/examples/build_registry.rs

Something similar, for gleam/hex packages would be what we are after I guess. It doesn't have to record them directly into an offline dependency provider as in that example. Especially if the mapping can be a bit akward for pre-release and the lot of things that are not natively supported by pubgrub. But a way to store that data in a single file easily loadable for tests/benchmarks would be awesome.

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

No branches or pull requests

3 participants