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

Add safety check for line breaks after single-line comments #182

Conversation

zaneduffield
Copy link
Collaborator

As discovered recently (#181), it's possible for subtle bugs to slip in
that result in a missing line break after a single-line comment.

While we strive to never let this happen, it's a good idea to make
sure that it doesn't happen. With this change, the missing line break
will be detected and inserted. The formatting won't be great after a
line break is suddenly inserted, but that's better than broken.

As discovered recently (integrated-application-development#181), it's possible for subtle bugs to slip in
that result in a missing line break after a single-line comment.

While we strive to never let this happen, it's a good idea to make
*sure* that it doesn't happen. With this change, the missing line break
will be detected and inserted. The formatting won't be great after a
line break is suddenly inserted, but that's better than broken.
@zaneduffield zaneduffield requested a review from jgardn3r March 6, 2025 02:44
Copy link

codecov bot commented Mar 6, 2025

Codecov Report

Attention: Patch coverage is 96.15385% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
core/src/defaults/reconstructor.rs 95.91% 0 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Collaborator

@jgardn3r jgardn3r left a comment

Choose a reason for hiding this comment

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

Looks good. A good safety check addition to provide more of a guarantee. We will improve handling across the board for unterminated strings with #189.

@zaneduffield zaneduffield merged commit 97a4128 into integrated-application-development:master Mar 11, 2025
6 checks passed
@zaneduffield zaneduffield deleted the singleline-comment-safety branch March 11, 2025 22:47
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