sentry-wizard icon indicating copy to clipboard operation
sentry-wizard copied to clipboard

Sentry Wizard should not be opinionated

Open kenn opened this issue 2 years ago • 5 comments

Environment

Sentry Wizard for Remix

Steps to Reproduce

  1. npx @sentry/wizard@latest -i remix

Expected Result

It should make minimal changes to the original source, only add wrapper, unmodified anywhere else.

Screenshot 2023-12-23 at 11 19 20

Actual Result

It also changes how new lines should be removed at each file, or add semicolon. Respect our preference. :)

Screenshot 2023-12-23 at 11 19 08

kenn avatar Dec 23 '23 02:12 kenn

Hi @kenn, thanks for writing in!

I generally agree with you that our wizard shouldn't format things differently to your preferred style.

However, we use recast which already has quite a bit of logic built in to detect the format of the file it parses and apply the same format when writing the modfied AST back to the file.

It might be worth checking our recast settings to be sure we do our best here but other than that I believe it's unlikely that we'll ever be able to always apply the exact formatting style.

Worth noting that also the Astro CLI (which for me is the gold standard for code mod wizards) a lot of the time gets formatting wrong. It's a tricky problem to solve.

If you have concrete ideas to improve things, I'm always happy to review PRs. Leaving this open for the time being but as I said it's unlikely that we can do a lot here.

Lms24 avatar Dec 23 '23 08:12 Lms24

Got it. Prettier fixes it on save, so it's not a big deal. I just wanted to report in case it's missed, but feel free to close this issue!

kenn avatar Dec 23 '23 09:12 kenn

We briefly discussed trying to detect if a project uses prettier and, if yes, running prettier from within the wizard. I think we didn't investigate this in greater detail due to time constraints but we could also revisit this idea.

Lms24 avatar Dec 23 '23 11:12 Lms24

That sounds like a good idea! Thanks @Lms24

kenn avatar Dec 23 '23 13:12 kenn

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Jan 16 '24 00:01 github-actions[bot]