Skip to content
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 files with dprint #711

Merged
merged 1 commit into from
May 30, 2023
Merged

Format files with dprint #711

merged 1 commit into from
May 30, 2023

Conversation

mgeisler
Copy link
Collaborator

@mgeisler mgeisler commented May 27, 2023

The dprint formatter is a flexible system which will use sandboxed WebAssembly formatters to format our code (mostly: it calls out to rustfmt for Rust code).

A particularly interesting feature is that dprint can format Rust code blocks in the Markdown files. However, before we turn that on, we need to have a way to normalize the Markdown text as it is extracted. That is so that the work put into the translations is kept after the reformatting.

Copy link
Collaborator

@djmitche djmitche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was everything under src/ correctly formatted already?

Also, we probably shouldn't be reformatting third-party source..

@mgeisler
Copy link
Collaborator Author

Was everything under src/ correctly formatted already?

Nope, it's explicitly excluded for now -- since we need google/mdbook-i18n-helpers#19 to be able to reformat this without losing the translations

Also, we probably shouldn't be reformatting third-party source..

Ah, good idea! It hadn't occurred to me to exclude this too 😄

The dprint formatter is a flexible system which will use sandboxed
WebAssembly formatters to format our code (mostly: it calls out to
`rustfmt` for Rust code).

A particularly interesting feature is that dprint can format Rust code
blocks in the Markdown files. However, before we turn that on, we need
to have a way to normalize the Markdown text as it is extracted[1].
That is so that the word put into the translations is kept after the
reformatting.

[1]: google/mdbook-i18n-helpers#19
@mgeisler mgeisler merged commit aaca44f into main May 30, 2023
@mgeisler mgeisler deleted the dprint branch May 30, 2023 15:04
NoahDragon pushed a commit to wnghl/comprehensive-rust that referenced this pull request Jul 19, 2023
The dprint formatter is a flexible system which will use sandboxed
WebAssembly formatters to format our code (mostly: it calls out to
`rustfmt` for Rust code).

A particularly interesting feature is that dprint can format Rust code
blocks in the Markdown files. However, before we turn that on, we need
to have a way to normalize the Markdown text as it is extracted[1].
That is so that the word put into the translations is kept after the
reformatting.

[1]: google/mdbook-i18n-helpers#19
@kantasv kantasv mentioned this pull request Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants