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

Append newline to printed documents #391

Merged
merged 4 commits into from
Aug 18, 2024
Merged

Append newline to printed documents #391

merged 4 commits into from
Aug 18, 2024

Conversation

Shane32
Copy link
Member

@Shane32 Shane32 commented Aug 18, 2024

I'd like this merged in for v9.4.0 in preparation for GraphQL.NET v8.0. Note: GraphQL.NET v7.x uses the v8 parser.

@Shane32 Shane32 self-assigned this Aug 18, 2024
return VisitAsync(node, context);
await VisitAsync(node, context).ConfigureAwait(false);
if (!context.NewLinePrinted && node is GraphQLDocument)
await writer.WriteLineAsync().ConfigureAwait(false);
Copy link
Member Author

Choose a reason for hiding this comment

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

Changes were made only within PrintAsync and only for printed documents, not for individual nodes being printed, or where VisitAsync was called directly and the context could be examined to determine whether or not a newline had been printed.

@Shane32 Shane32 requested review from gao-artur and sungam3r August 18, 2024 03:51
Comment on lines 140 to 142

extend type Foo @onType No newline at end of file
extend type Foo @onType
Copy link
Member Author

Choose a reason for hiding this comment

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

This PR fixes these issues -- generated documents did not include a terminating newline before.

Copy link

codecov bot commented Aug 18, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.10%. Comparing base (b201d09) to head (10315dd).

Files Patch % Lines
src/GraphQLParser/Visitors/SDLPrinter.cs 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #391      +/-   ##
==========================================
- Coverage   96.12%   96.10%   -0.02%     
==========================================
  Files          89       89              
  Lines        5030     5032       +2     
  Branches      500      500              
==========================================
+ Hits         4835     4836       +1     
  Misses        194      194              
- Partials        1        2       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Shane32 Shane32 merged commit a440946 into master Aug 18, 2024
6 checks passed
@Shane32 Shane32 deleted the appendnewline branch August 18, 2024 04:21
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