Skip to content

Commit bdffdb2

Browse files
authored
.sync/rust_config/Makefile.toml: Add check task (#241)
The VS Code `rust-analyzer` plugin uses `cargo check` to find problems. We use custom flags/target info with `cargo make`. This adds a `cargo make check` command that reuses similar flags to our build so the check results are similar. `check_json` is added to be used by tools like VS Code that need JSON output. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
1 parent 67df77c commit bdffdb2

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.sync/rust_config/Makefile.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ clear = true
3636
command = "cargo"
3737
args = ["build", "@@split(PACKAGE_TARGET, )", "@@split(BUILD_FLAGS, )"]
3838

39+
[tasks.check]
40+
description = "Checks rust code for errors. Example `cargo make check`"
41+
clear = true
42+
command = "cargo"
43+
args = ["check", "@@split(PACKAGE_TARGET, )", "@@split(BUILD_FLAGS, )"]
44+
45+
[tasks.check_json]
46+
description = "Checks rust code for errors with results in JSON. Example `cargo make check_json`"
47+
clear = true
48+
command = "cargo"
49+
args = ["check", "@@split(PACKAGE_TARGET, )", "@@split(BUILD_FLAGS, )", "--message-format=json"]
50+
3951
[tasks.test]
4052
description = "Builds all rust tests in the workspace. Example `cargo make test`"
4153
clear = true

0 commit comments

Comments
 (0)