getsentry / sentry-wizard

Sentry Project Setup Wizard
MIT License
193 stars 48 forks source link

Sentry Wizard should not be opinionated #521

Closed kenn closed 1 month ago

kenn commented 10 months ago

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
Lms24 commented 10 months ago

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.

kenn commented 10 months ago

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!

Lms24 commented 10 months ago

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.

kenn commented 10 months ago

That sounds like a good idea! Thanks @Lms24

github-actions[bot] commented 9 months ago

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 🥀