Skip to content

Add sembr linebreaks #17544

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Add sembr linebreaks #17544

wants to merge 6 commits into from

Conversation

benjie
Copy link

@benjie benjie commented Jun 2, 2025

Description

This PR enhances proseWrap: "always" to follow Semantic Line Breaks (SemBr), inserting line breaks after [.!?;] characters (where appropriate). This reduces noisy diffs caused by full-paragraph re-wrapping, limiting impact of re-wrapping to (at most) the sentence and making PRs easier to review.

Example diff from before this change (from a GraphQL spec PR):

-Fragments can also be defined inline within a selection set. This is useful for
-conditionally including fields based on a type condition or applying a directive
-to a selection set.
+Fragments can also be defined inline within a _selection set_. This is useful
+for conditionally including fields based on a type condition or applying a
+directive to a selection set.

After this change, only the sentence would be impacted making the changes clearer:

-Fragments can also be defined inline within a selection set.
+Fragments can also be defined inline within a _selection set_.
 This is useful for conditionally including fields based on a type condition or
 applying a directive to a selection set.

hardline upgrades are only used where line was already used, so I think CJK support should be fine?

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

Copy link

netlify bot commented Jun 2, 2025

Deploy Preview for prettier ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 8f9a0de
🔍 Latest deploy log https://app.netlify.com/projects/prettier/deploys/683d55e86402a10008dc31c8
😎 Deploy Preview https://deploy-preview-17544--prettier.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@benjie benjie changed the title [semver major] Add sembr linebreaks Add sembr linebreaks Jun 2, 2025
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.

1 participant