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

Fix issue 22770: C++ header generator generates trailing newlines #13649

Merged
merged 2 commits into from
Mar 3, 2022

Conversation

ljmf00
Copy link
Member

@ljmf00 ljmf00 commented Feb 13, 2022

This patch adds logic to check for trailing newlines in dtoh generator and
remove them.

Signed-off-by: Luís Ferreira contact@lsferreira.net


Related to #13638 .

@ljmf00 ljmf00 requested a review from ibuclaw as a code owner February 13, 2022 22:40
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ljmf00!

Bugzilla references

Auto-close Bugzilla Severity Description
22770 enhancement C++ header generator generates trailing newlines

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#13649"

src/dmd/dtoh.d Outdated Show resolved Hide resolved
@ljmf00
Copy link
Member Author

ljmf00 commented Feb 14, 2022

@MoonlightSentinel you self-requested review but didn't leave a comment, perhaps you left it pending?

src/dmd/dtoh.d Outdated Show resolved Hide resolved
src/dmd/dtoh.d Outdated
// prevent trailing newlines
foreach_reverse (i, ch; buf)
{
if (ch != '\n')
Copy link
Contributor

@MoonlightSentinel MoonlightSentinel Feb 14, 2022

Choose a reason for hiding this comment

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

Produces invalid line endings on windows

src/dmd/dtoh.d Outdated Show resolved Hide resolved
@RazvanN7
Copy link
Contributor

RazvanN7 commented Mar 1, 2022

ping @ljmf00

@ljmf00 ljmf00 force-pushed the dtoh-fix-trailing-new-line branch from c91c0de to 0a12fae Compare March 2, 2022 18:01
@ljmf00
Copy link
Member Author

ljmf00 commented Mar 3, 2022

Seems like my Sourcegraph plugin is telling me that Windows builds are not generating coverage
image

@ljmf00
Copy link
Member Author

ljmf00 commented Mar 3, 2022

ping @ljmf00

Thanks for pinging. @MoonlightSentinel can you re-review?

@ljmf00 ljmf00 requested a review from MoonlightSentinel March 3, 2022 01:03
Copy link
Contributor

@MoonlightSentinel MoonlightSentinel left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

src/dmd/common/outbuffer.d Outdated Show resolved Hide resolved
@MoonlightSentinel
Copy link
Contributor

Seems like my Sourcegraph plugin is telling me that Windows builds are not generating coverage

Weird. The coverage files includes those lines on windows and the corresponding file was uploaded to CodeCov

ljmf00 added 2 commits March 3, 2022 15:07
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
This patch adds logic to check for trailing newlines in dtoh generator and
remove them.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
@ljmf00
Copy link
Member Author

ljmf00 commented Mar 3, 2022

Seems like my Sourcegraph plugin is telling me that Windows builds are not generating coverage

Weird. The coverage files includes those lines on windows and the corresponding file was uploaded to CodeCov

According to codecov https://app.codecov.io/gh/dlang/dmd/branch/dtoh-fix-trailing-new-line the coverage decreased a lot on my change. Probably worth investigating it.

EDIT: I can't understand why, anyway, the logs don't show anything abnormal.

@dlang-bot dlang-bot merged commit 9d29e83 into dlang:master Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants