1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-08 18:46:15 +02:00

Unified Formatting/Preparation (#1431)

Closes issue #1426

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
This commit is contained in:
Gourav 2023-10-30 03:32:16 +05:30 committed by GitHub
parent 77ab1ab6c4
commit bcd7cecdaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 38 deletions

View File

@ -3,20 +3,30 @@
We'd love to accept your patches and contributions to this project. There are We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow. just a few small guidelines you need to follow.
Make sure you can build the book, and that `mdbook serve` works. Please follow
the [instructions in the README].
[instructions in the README]: README.md#building
## Formatting ## Formatting
Please ensure that your files are formatted consistently. We use [`dprint`] for Please ensure that your files are formatted consistently. We use a few tools for
this and you should follow their installation instructions for your platform. We this:
rely on a few tools in addition to `dprint`:
- [`dprint`] for driving the formatting.
- [`rustfmt`] for formatting Rust code. - [`rustfmt`] for formatting Rust code.
- [`yapf`] for formatting Python code. - [`yapf`] for formatting Python code.
- [`msgcat`] for formatting PO files. - [`msgcat`] for formatting PO files.
Run `dprint fmt` to automatically format all files.
### Linux ### Linux
On Debian, you install `rustfmt` via `rustup` and you can install the other Install `dprint` using their
tools using [installation instructions](https://dprint.dev/install/) and install `rustfmt`
via `rustup`.
On Debian, you can install the other tools using:
```sh ```sh
sudo apt install yapf3 gettext sudo apt install yapf3 gettext
@ -24,10 +34,10 @@ sudo apt install yapf3 gettext
### MacOS ### MacOS
On MacOS with [Homebrew], you can install with: On MacOS with [Homebrew], you can install the necessary tools with:
```shell ```shell
brew install yapf gettext brew install dprint yapf gettext
``` ```
### Windows ### Windows

View File

@ -31,37 +31,9 @@ GNU Gettext utilities below.
## Preparation ## Preparation
### Gettext Please make sure you can [build the course](README.md#building). You will also
need the `msgmerge` and `msgcat` Gettext tool installed. Please see our
You will need the [Gettext] utilities (`msginit`, `msgmerge`) and [`dprint`]. [contribution guide](CONTRIBUTING.md#formatting) for details.
On Debian and Ubuntu, you can install Gettext with:
```shell
sudo apt install gettext
```
On MacOS with [Homebrew](https://brew.sh/), you can install with:
```shell
brew install gettext
```
### `dprint`
Install `dprint` using their
[installation instructions](https://dprint.dev/install/).
[`dprint`]: https://dprint.dev/
Alternatively, on MacOS with [Homebrew](https://brew.sh/), you can install with:
```shell
brew install dprint
```
Ensure you can build the book, and that `mdbook serve` works. For this, follow
the instructions in the [README](README.md).
## Creating and Updating Translations ## Creating and Updating Translations