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

Mark an issue on failed formatting instead of only logging to console #10

Open
laralove143 opened this issue Oct 2, 2021 · 2 comments
Labels
enhancement Improve an existing feature

Comments

@laralove143
Copy link
Contributor

rustfmt already tells where it failed to format (strings etc) we could make nova parse that as an info or warn level issue. would make it much better ux. right now they’d have to:

  1. check console
  2. see where it failed to format in the logs
  3. manually navigate there and fix it
  4. save so it’s formatted again
  5. repeat for every place that’s failed to format
@kilbd
Copy link
Owner

kilbd commented Oct 10, 2021

I finally had time to play with some Rust code, and I think you're right that Issues are the best way to alert users that there was a formatting error. I'll have to see if I can make this happen, but there are a few challenges:

  • Errors aren't in JSON format, so I'd need to parse messages myself, which is more prone to errors
  • Messages are spread across multiple lines, so an additional parsing challenge is grouping together lines for the same error
  • The error message has the start of the range for the line, and I'd need to calculate the end of the range

This seems very doable, but could take some time to get it right.

@kilbd kilbd added the enhancement Improve an existing feature label Oct 10, 2021
@laralove143
Copy link
Contributor Author

i think there's other issues with higher priority, we might turn back once they're done though! also i think rustfmt nightly has a json output option, if not, it shouldn't be that hard to parse manually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants