Enforce consistent punctuation in algorithms#1069
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.
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:
mjmahone
left a comment
There was a problem hiding this comment.
Very glad you've written a lint for these consistency issues
|
|
||
| - 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.
Why no full stop on that line?
There was a problem hiding this comment.
That is a great question. I wonder how this escaped the editing...
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Would the unordered list be preferred in this case?
There was a problem hiding this comment.
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