Skip to content

Enforce consistent punctuation in algorithms#1069

Merged
Keweiqu merged 4 commits intographql:mainfrom
benjie:more-algorithm-punctuation-fixes
Mar 7, 2024
Merged

Enforce consistent punctuation in algorithms#1069
Keweiqu merged 4 commits intographql:mainfrom
benjie:more-algorithm-punctuation-fixes

Conversation

@benjie
Copy link
Copy Markdown
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

@netlify
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

- 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

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
Copy Markdown
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
Copy Markdown
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.

6 participants