summaryrefslogtreecommitdiff
path: root/docs/markdown
diff options
context:
space:
mode:
Diffstat (limited to 'docs/markdown')
-rw-r--r--docs/markdown/howtox.md20
-rw-r--r--docs/markdown/snippets/clippy.md5
-rw-r--r--docs/markdown/snippets/num-processes.md2
3 files changed, 26 insertions, 1 deletions
diff --git a/docs/markdown/howtox.md b/docs/markdown/howtox.md
index 4a57e8569..ba6a3b8f8 100644
--- a/docs/markdown/howtox.md
+++ b/docs/markdown/howtox.md
@@ -239,6 +239,26 @@ And then pass it through the variable (remember to use absolute path):
$ SCANBUILD=$(pwd)/my-scan-build.sh ninja -C builddir scan-build
```
+## Use clippy
+
+If your project includes Rust targets, you can invoke clippy like this:
+
+```console
+$ meson setup builddir
+$ ninja -C builddir clippy
+```
+
+Clippy will also obey the `werror` [builtin option](Builtin-options.md#core-options).
+
+By default Meson uses as many concurrent processes as there are cores
+on the test machine. You can override this with the environment
+variable `MESON_NUM_PROCESSES`.
+
+Meson will look for `clippy-driver` in the same directory as `rustc`,
+or try to invoke it using `rustup` if `rustc` points to a `rustup`
+binary. If `clippy-driver` is not detected properly, you can add it to
+a [machine file](Machine-files.md).
+
## Use profile guided optimization
Using profile guided optimization with GCC is a two phase
diff --git a/docs/markdown/snippets/clippy.md b/docs/markdown/snippets/clippy.md
new file mode 100644
index 000000000..14bcc7742
--- /dev/null
+++ b/docs/markdown/snippets/clippy.md
@@ -0,0 +1,5 @@
+## Meson can run "clippy" on Rust projects
+
+Meson now defines a `clippy` target if the project uses the Rust programming
+language. The target runs clippy on all Rust sources, using the `clippy-driver`
+program from the same Rust toolchain as the `rustc` compiler.
diff --git a/docs/markdown/snippets/num-processes.md b/docs/markdown/snippets/num-processes.md
index c484d930f..533637790 100644
--- a/docs/markdown/snippets/num-processes.md
+++ b/docs/markdown/snippets/num-processes.md
@@ -5,4 +5,4 @@ the amount of parallel jobs to run; this was useful when `meson test` is
invoked through `ninja test` for example. With this version, a new variable
`MESON_NUM_PROCESSES` is supported with a broader scope: in addition to
`meson test`, it is also used by the `external_project` module and by
-Ninja targets that invoke `clang-tidy` and `clang-format`.
+Ninja targets that invoke `clang-tidy`, `clang-format` and `clippy`.