Thanks to visit codestin.com
Credit goes to github.com

Skip to content

style: Prefer single quotes #481

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

Closed
wants to merge 1 commit into from
Closed

Conversation

eemeli
Copy link
Collaborator

@eemeli eemeli commented Sep 19, 2023

Update our Prettier styles to prefer single quotes, as requested in #477 (comment).

@eemeli eemeli requested review from aphillips and stasm September 19, 2023 08:03
@eemeli
Copy link
Collaborator Author

eemeli commented Sep 19, 2023

Requesting fast-tracking.

@eemeli eemeli added the fast-track Editorial change permitted to use fast-track merge rules label Sep 19, 2023
Copy link
Collaborator

@stasm stasm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we configure Prettier to instead not touch code blocks at all? We may want to use them to describe examples that are explicitly not well formatted. I'd like Prettier to not get in the way.

@eemeli eemeli marked this pull request as ready for review September 19, 2023 09:16
@eemeli
Copy link
Collaborator Author

eemeli commented Sep 19, 2023

Can we configure Prettier to instead not touch code blocks at all? We may want to use them to describe examples that are explicitly not well formatted. I'd like Prettier to not get in the way.

You can do so in your markdown file by prepending a comment before the code block: https://prettier.io/docs/en/ignore#markdown

@aphillips
Copy link
Member

You can do so in your markdown file by prepending a comment before the code block

This is about our repo's configuration. I'm with @stasm: can we make it just ignore the code blocks? Switching to single-quotes is great for JS examples---not so much for other languages (which we also quote sometimes)

@eemeli
Copy link
Collaborator Author

eemeli commented Sep 19, 2023

There isn't a way to ignore all markdown code blocks, but the link I mention above shows how to skip prettifying specific cases.

Including a minimal config (as added here) will also make Prettier use that explicitly, and not e.g. whatever a user has configured as their default in an editor plugin.

@stasm
Copy link
Collaborator

stasm commented Sep 19, 2023

I know you care about this, @eemeli, and that you put effort to configure the bot, but I continue to have doubts about it, and this issue showcases another friction point that I think we could simply not have.

I understand using Prettier for code, but in my mind there's less utility for prose, even when written in Markdown. Prose is free-form and sometimes will not look exactly like the linter wants it to look, and that's OK. Humans are good at parsing ambiguous input :)

What problems does the bot solve? I browsed through some of its recent commits, and it mostly removes accidental trailing spaces, and converts my bullet points from * to -. Are these actually harmful?

OTOH, the bot adds noise to the PR, and breaks the flow of pushing to the branch while still working on it via local edits. I now have to stash, push, pull, pop stash, resolve conflicts, for arguably little benefit.

And now, as we've seen in #477 (comment), the bot also overwrites an example whose purpose was to use a different style.

I can learn to live with this, but I guess I'm going to also be a bit grumpy every time I hit a merge conflict between my pushes.

@aphillips
Copy link
Member

I'm with @stasm. This is generating a lot of work/noise/turbulence for not much noticeable benefit. I'm a big believer in standardized formatting, but this tool is consuming a lot of cycles that could better be applied to the many work items we have. If I promise to practice using - for bullets, can we live without it?!? 😿

@eemeli
Copy link
Collaborator Author

eemeli commented Oct 10, 2023

Closing in favour of #491.

@eemeli eemeli closed this Oct 10, 2023
@eemeli eemeli deleted the single-quote branch October 10, 2023 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fast-track Editorial change permitted to use fast-track merge rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants