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 indentation when printing arguments #312

Merged
merged 2 commits into from
Apr 21, 2023
Merged

Fix indentation when printing arguments #312

merged 2 commits into from
Apr 21, 2023

Conversation

sungam3r
Copy link
Member

fixes #311

@github-actions github-actions bot added the test Pull request that adds new or changes existing tests label Apr 21, 2023
@sungam3r sungam3r added the bugfix Pull request that fixes a bug label Apr 21, 2023
@sungam3r sungam3r self-assigned this Apr 21, 2023
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<VersionPrefix>9.0.1-preview</VersionPrefix>
<VersionPrefix>9.0.2-preview</VersionPrefix>
Copy link
Member Author

Choose a reason for hiding this comment

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

@Shane32 I would like to switch to MinVer here like I suggested in graphql-dotnet/graphql-dotnet#3562 so we can see how this looks and feels.

Comment on lines +876 to +881
node is GraphQLFieldDefinition ||
node is GraphQLEnumValueDefinition ||
node is GraphQLRootOperationTypeDefinition ||
node is GraphQLDirectiveLocations && Options.EachDirectiveLocationOnNewLine ||
node is GraphQLUnionMemberTypes && Options.EachUnionMemberOnNewLine ||
node is GraphQLArgumentsDefinition && node.Comments?.Count > 0

Check notice

Code scanning / CodeQL

Complex condition Note

Complex condition: too many logical operations in this expression.
@@ -721,7 +721,7 @@ protected override async ValueTask VisitArgumentAsync(GraphQLArgument argument,
protected override async ValueTask VisitArgumentsDefinitionAsync(GraphQLArgumentsDefinition argumentsDefinition, TContext context)
{
await VisitAsync(argumentsDefinition.Comments, context).ConfigureAwait(false);
await context.WriteAsync("(").ConfigureAwait(false);
await VisitAsync(LiteralNode.Wrap("("), context).ConfigureAwait(false);
Copy link
Member Author

@sungam3r sungam3r Apr 21, 2023

Choose a reason for hiding this comment

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

General note - any literal printed first (after optional comment or description node) in VisitXXX method should be wrapped into LiteralNode for proper indentation.

@codecov-commenter
Copy link

Codecov Report

Merging #312 (5b31f06) into master (f1cb807) will increase coverage by 0.00%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##           master     #312   +/-   ##
=======================================
  Coverage   96.23%   96.23%           
=======================================
  Files          85       85           
  Lines        4889     4892    +3     
  Branches      475      476    +1     
=======================================
+ Hits         4705     4708    +3     
  Misses        184      184           
Impacted Files Coverage Δ
src/GraphQLParser/Visitors/SDLPrinter.cs 99.74% <100.00%> (+<0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@sungam3r sungam3r merged commit bb6a168 into master Apr 21, 2023
6 checks passed
@sungam3r sungam3r deleted the args branch April 21, 2023 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Pull request that fixes a bug test Pull request that adds new or changes existing tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9.0.1 formatting - lost indentation of arguments (fine in 8.x)
2 participants