Format the spec with prettier#727
Conversation
This comment has been minimized.
This comment has been minimized.
benjie
left a comment
There was a problem hiding this comment.
I've now reviewed all the non-spec markdown changes (spec markdown changes were validated by asserting that there is no diff to the generated HTML) and am happy that the changes are fine 👍
| | Typescript | [Discriminated Union](http://www.typescriptlang.org/docs/handbook/advanced-types.html#discriminated-unions) | ✅ | ✅ | | ||
| | Rust | [Enum](https://doc.rust-lang.org/rust-by-example/custom_types/enum.html) | ✅ | ✅ | | ||
| | Swift | [Enumeration](https://docs.swift.org/swift-book/LanguageGuide/Enumerations.html) | ✅ | ✅ | | ||
| | Haskell | [Algebraic data types](http://learnyouahaskell.com/making-our-own-types-and-typeclasses) | ✅ | ✅ | |
There was a problem hiding this comment.
This is such an improvement!
|
I recommend that #832 is merged separately before this PR to make reviewing the git history more straightforward. |
|
@benjie should we merge this one after going through the rest of the pre-cut editorial process? I'm marking PRs I want to place attention on as clear candidates for the next spec cut and anticipate prettier editing merge conflicts. Inevitably there will be open PRs that will need to rebase and run prettier, but maybe we should try to limit most of those for after the spec cut? |
|
@leebyron Yes, lets do this as the very last step before the spec cut 👍 Given the proof that there's no diff currently I think we can expect that changes will be minimal (code formatting, for example). I'm happy to rebase/fix/etc this PR when the time comes (or you can; the final commit is auto-generated so just don't |
|
We might want to keep an eye on prettier/prettier#10655 being released |
e5d241d to
6c81ed8
Compare
|
I've rebased this, upgraded to the latest prettier, and reapplied the changes. Asserting there's no diff is a little more complex now because of the new shows that, ignoring I believe this is safe to merge now 👍 |
|
✔️ Deploy Preview for graphql-spec-draft ready! 🔨 Explore the source changes: b444b37 🔍 Inspect the deploy log: https://app.netlify.com/sites/graphql-spec-draft/deploys/61d6e7016a85e900079ffd6d 😎 Browse the preview: https://deploy-preview-727--graphql-spec-draft.netlify.app |
|
This has been updated again and is ready to merge 👍 |
This PR has been work in progress for a while; and a lot has changed. Please see the edit history for previous versions of this comment.
Thanks to advances to
spec-md, we can now format the GraphQL spec withprettier! This means consistent formatting throughout the document, and no need for PR comments about there being too many or two few linebreaks 😉Prettier has been desired in the GraphQL spec for almost 4 years - I'm excited to have worked with @leebyron over the past year to have finally made this a reality! 🎉
This PR is formed of two commits:
yarn format(ornpm run format) command which formats the repository.yarn formatand commits the results.To view the HTML diff:
mainyarn buildmv public/draft/index.html before.html(usingmvwill also ensure that the old output cannot be reused)yarn buildmv public/draft/index.html after.htmldata-sourceURLs; let's remove these:cat before.html | sed 's/ data-source="[^"]*"//g' > before-nosource.htmlcat after.html | sed 's/ data-source="[^"]*"//g' > after-nosource.htmlYou can now see the versions with data-source removed are identical: