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

Enforce consistent punctuation in algorithms #1069

Merged
merged 4 commits into from
Mar 7, 2024

Conversation

benjie
Copy link
Member

@benjie benjie commented Dec 14, 2023

Follow up to #1067 with thorough check through all algorithm steps, and a CI check to ensure there's no regressions.

Using consistent formatting within the spec will make it easier to read, easier to search through, and easier for automated tools to parse it.

cc @yaacovCR

Copy link

netlify bot commented Dec 14, 2023

Deploy Preview for graphql-spec-draft ready!

Name Link
🔨 Latest commit a303f0c
🔍 Latest deploy log https://app.netlify.com/sites/graphql-spec-draft/deploys/657b2b473edb2600085bf199
😎 Deploy Preview https://deploy-preview-1069--graphql-spec-draft.netlify.app/draft
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@benjie benjie added the ✏️ Editorial PR is non-normative or does not influence implementation label Dec 14, 2023
@benjie
Copy link
Member Author

benjie commented Dec 14, 2023

@graphql/tsc Can I get a couple +1's on this? You can skip over the code of the formatting script if you want, that's just a script to enforce the changes. The actual spec changes are mostly adding . or : and wrapping true/false/null in {}.

console.dir(line);
console.dir(nextLine);
console.log();
// TODO: process.exitCode = 1;
Copy link
Member Author

@benjie benjie Dec 14, 2023

Choose a reason for hiding this comment

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

This TODO is due to bad formatting in MapSourceToResponseEvent, but that's something that's a little more controversial so I raised a separate PR for it and removed the TODO here:

2d1c477

Copy link
Contributor

@mjmahone mjmahone left a comment

Choose a reason for hiding this comment

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

Very glad you've written a lint for these consistency issues

Copy link
Contributor

@Keweiqu Keweiqu left a comment

Choose a reason for hiding this comment

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

Fun!

@Keweiqu Keweiqu merged commit 0ba7cdf into graphql:main Mar 7, 2024
9 checks passed
@@ -1247,22 +1247,22 @@ input type.

Type : Name

- Let {name} be the string value of {Name}
- Let {name} be the string value of {Name}.
- Let {type} be the type defined in the Schema named {name}
Copy link
Contributor

@BoD BoD Mar 7, 2024

Choose a reason for hiding this comment

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

Why no full stop on that line?

Copy link
Member Author

Choose a reason for hiding this comment

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

That is a great question. I wonder how this escaped the editing...

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah; it's because this isn't detected as an algorithm, algorithms start Foo(a, b, c):, so this has to be manually addressed.

@@ -919,7 +919,7 @@ of rules must be adhered to by every Object type in a GraphQL schema.
3. The argument must accept a type where {IsInputType(argumentType)}
returns {true}.
4. If argument type is Non-Null and a default value is not defined:
- The `@deprecated` directive must not be applied to this argument.
1. The `@deprecated` directive must not be applied to this argument.
Copy link
Contributor

Choose a reason for hiding this comment

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

Would the unordered list be preferred in this case?

Copy link
Member Author

Choose a reason for hiding this comment

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

IIRC, it would be the only unordered item in any of our equivalent algorithms, so I changed it for consistency.

@benjie benjie deleted the more-algorithm-punctuation-fixes branch March 11, 2024 16:55
@benjie benjie mentioned this pull request Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✏️ Editorial PR is non-normative or does not influence implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants