Update Code Formatting and Linting section in CONTRIBUTING.md

This commit is contained in:
Jonas Platte 2021-01-08 21:00:24 +01:00
parent f42581850f
commit d39966442d
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67

View File

@ -133,13 +133,16 @@ Also, `serde_json::Value` should be imported as `JsonValue`.
### Code Formatting and Linting ### Code Formatting and Linting
Use `rustfmt` to format your code and `clippy` to lint your code. Before Use `rustfmt` to format your code and `clippy` to lint your code¹. Before
committing your changes, go ahead and run `cargo fmt` and committing your changes, go ahead and run `cargo fmt` and `cargo clippy`² on the
`cargo clippy --all-targets --all-features` on the repository to make sure that repository to make sure that the formatting and linting checks pass in CI. Note
the formatting and linting checks pass in CI. Note that `clippy` warnings are that `clippy` warnings are reported as errors in CI builds, so make sure to
reported as errors in CI builds, so make sure to handle those before handle those before comitting as well.
comitting as well. (To install the tools, run `rustup component add rustfmt
clippy`.) ¹ To install the tools, run `rustup component add rustfmt clippy`.
² If you modified feature-gated code (`#[cfg(feature = "something")]`), you will
have to pass `--all-features` or `--features something` to clippy for it to
check that code
### Commit Messages ### Commit Messages