-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Enable Prettier formatting for documentation #10597
Conversation
lb-
commented
Jun 24, 2023
- Exclude release notes as these are long lived and not currently aligned with Prettier preferences
- Exclude the .github/ folder for bespoke requirements in these template files
- Upgrade prettier version & re-format (one css file change)
- See Automated checks for formatting and styleguide in the documentation #8753
- Also Finish first batch of getting started tutorial changes #10579 (comment)
Happy to add something that also reports the exact files that need changing and how, this is a long standing gap in Prettier but there is a work around. prettier/prettier#6885 (comment) I understand the main concern for this is that it adds friction for contributors, but think it's still worth doing. |
f9e0794
to
2ff0cde
Compare
Manage this branch in SquashTest this branch here: https://lb-featureprettier-format-docs-i1e0m.squash.io |
.prettierignore
Outdated
@@ -8,7 +8,8 @@ coverage/ | |||
static | |||
_build | |||
# File types which Prettier supports but we don’t want auto-formatting. | |||
*.md | |||
.github/ |
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’m not sure about this one. Perhaps we should format it all by default and use <!-- prettier-ignore -->
comments for parts of the files that have very specific formatting?
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.
It will be very weird to see that comment in the pull request and issue templates though
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 can just ignore the one specific file that we have added multiple line-breaks to
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 also tried the comment and it did not seem to work.
Used syntax as per https://prettier.io/docs/en/ignore.html#markdown
- Exclude release notes as these are long lived and not currently aligned with Prettier preferences - Exclude the pull request template as we want multiple line breaks in this file - Upgrade prettier version & re-format
2ff0cde
to
1df4f17
Compare
Rebased this, only ignoring one file in the github folder now (Pull Request template) and also ignoring the contributors.md file. I did some further investigation into a script to try a git diff output but I think this would not work in our CI. You do get an output with at least the file name though, for example.
|
Going to mark this as a draft, may not be worth pursuing at this time but still keen on feedback from the Google Summer of Docs side of things - @activus-d |
Closing this, maintaining this PR is a bit annoying. Still think it's worth a discussion but I'll bring this up at a core team meeting instead. |