-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Enforce consistent punctuation in algorithms #1069
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
Conversation
✅ Deploy Preview for graphql-spec-draft ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@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 |
console.dir(line); | ||
console.dir(nextLine); | ||
console.log(); | ||
// TODO: process.exitCode = 1; |
There was a problem hiding this comment.
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:
There was a problem hiding this 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fun!
@@ -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} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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