Skip to content

Fixes some issues with line wrapping around inline code #215

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 4 commits into
base: main
Choose a base branch
from

Conversation

natecook1000
Copy link
Member

Summary

  • Inline code that would have wrapped to the beginning of a line no longer gets an extra blank line before it.
  • Punctuation immediately following inline code is no longer pushed to the next line.
  • A line break is inserted before a symbolic link that would overflow the preferred line length.

Dependencies

n/a

Testing

Unit tests include new test cases that validate this functionality.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary

- Inline code that would have wrapped at the beginning of a line
  no longer gets an extra blank line before it.
- Punctuation immediately following inline code is no longer
  pushed to the next line.
- A line break is inserted before a symbolic link that would overflow
  the preferred line length.
@natecook1000
Copy link
Member Author

@swift-ci Please test

@natecook1000
Copy link
Member Author

@swift-ci Please test

@natecook1000 natecook1000 requested a review from d-ronnqvist June 4, 2025 19:34
Copy link
Contributor

@d-ronnqvist d-ronnqvist left a comment

Choose a reason for hiding this comment

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

The code looks good but I found the test data a bit hard to reason about.

Comment on lines +975 to +992
let source = """
Because options are parsed before arguments, an option that consumes or
suppresses the `--` terminator can prevent a ``postTerminator`` argument
array from capturing any input. In particular, the
``SingleValueParsingStrategy/unconditional``,
``ArrayParsingStrategy/unconditionalSingleValue``, and
``ArrayParsingStrategy/remaining`` parsing strategies can all consume
the terminator as part of their values.
"""
let expected = """
Because options are parsed before arguments, an option that consumes or
suppresses the `--` terminator can prevent a ``postTerminator`` argument
array from capturing any input. In particular, the
``SingleValueParsingStrategy/unconditional``,
``ArrayParsingStrategy/unconditionalSingleValue``, and
``ArrayParsingStrategy/remaining`` parsing strategies can all consume the
terminator as part of their values.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: This example data confused me for a bit because the input was already wrapped almost the same as the expected output (only one word wrapped differently). Because of this, I found it difficult to reason about how this test would have behaved differently without the changes in this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! That wrapping change wasn't intended – I'll fix that and change the example data to describe the behavior it's validating. (I wasn't quite sure how to go here since these are fixes for bugs that aren't exposed in the current tests.)

Comment on lines +1460 to +1469
let source = """
Perform an atomic logical AND operation on the value referenced by
`pointer` and return the original value, applying the specified memory
ordering.
"""
let expected = """
Perform an atomic logical AND operation on the value referenced by
`pointer` and return the original value, applying the specified memory
ordering.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: The input and expected output are identical. Because of this, I find it harder to reason about how this test would have behaved differently without the changes in this PR.

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.

2 participants