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

chore: add proseWrap prettier config to wrap markdown #458

Merged
merged 1 commit into from May 28, 2020

Conversation

ctavan
Copy link
Member

@ctavan ctavan commented May 27, 2020

I no longer want to try to achieve consistent line lengths in markdown
so I'd prefer prettier to do that for me.

I no longer want to try to achieve consistent line lengths in markdown
so I'd prefer prettier to do that for me.
@ctavan ctavan requested a review from broofa May 27, 2020 20:16
@LinusU
Copy link
Member

LinusU commented May 28, 2020

Personally, I think it's very much better to not wrap lines in .md files, and let the editor do that instead.

With this change you have to save the file and run prettier, instead of just having the text flow naturally as you type it in your editor. You are also now forced to 80 chars width instead of the size of your window.

Lastly, I think that the diffs often become much harder to read, when inserting a few words in the beginning of the paragraph changes every line under it. When the paragraph is on one line in the source, GitHub (and others) shows a nice diff that highlights the added words in green, that won't work when multiple lines are changed around...

@broofa broofa changed the title chore: add proseWarp prettier config to warp markdown chore: add proseWrap prettier config to wrap markdown May 28, 2020
Copy link
Member

@broofa broofa left a comment

Choose a reason for hiding this comment

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

@LinusU While there is some merit to your point about the impact on diffs, the reality is that different developers have different editor settings, which means this is already an issue. E.g. I have VIM set with textwidth=80, so my editor likely reformats any long lines you author. And vice-versa, of course.

Having a common convention enforced on commit isn't ideal for any one developer, but minimizes churn as a whole.

@ctavan
Copy link
Member Author

ctavan commented May 28, 2020

I think the crucial thing is that this way we enforce a consistent style with the commit hooks or if people don't have them set up properly at least the CI will fail. Otherwise we end up with an inconsistent mess like right now where some paragraphs in the same file apparently have been written with a soft-wrapping editor and others with a hard-wrapping editor…

So in this case I'm with @broofa 😛

@ctavan ctavan merged commit d5ce415 into master May 28, 2020
@ctavan ctavan deleted the add-prose-wrap-option branch May 28, 2020 18:38
@LinusU
Copy link
Member

LinusU commented May 28, 2020

Would have preferred to set prettier to put everything on one line then, that way any developer can soft-wrap to whatever width they want... Anyhow, not a big deal...

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

Successfully merging this pull request may close these issues.

None yet

3 participants