-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Format the spec with prettier #727
Conversation
This comment has been minimized.
This comment has been minimized.
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.
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 👍
rfcs/InputUnion.md
Outdated
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 format
and commits the results.To view the HTML diff:
main
yarn build
mv public/draft/index.html before.html
(usingmv
will also ensure that the old output cannot be reused)yarn build
mv public/draft/index.html after.html
data-source
URLs; let's remove these:cat before.html | sed 's/ data-source="[^"]*"//g' > before-nosource.html
cat after.html | sed 's/ data-source="[^"]*"//g' > after-nosource.html
You can now see the versions with data-source removed are identical: