From c64017de7b6cffbacf25e312ac3043c492522b5f Mon Sep 17 00:00:00 2001 From: Bob Hyman Date: Fri, 29 Sep 2023 10:51:19 -0700 Subject: [PATCH] `toolkit check pr` does same clippy checks as github CI (#10528) Align the clippy checks done by `toolkit check pr` with the ones done by github CI when you post a PR. Motivated in no small part by my frustration at having the third PR in one day fail due to a lint that `toolkit check pr` didn't find! # Description Change definition of `toolkit clippy` * always run checks on all crates in the workspace * always run checks on tests as well as non-test code * don't check for `unwrap_used`. There are many (legit) uses of `.unwrap()` in tests, * # User-Facing Changes Changes to `toolkit clippy`: * remove `--workspace` switch * `--features` is no longer mutually exclusive with `--workspace` # Tests + Formatting n/a # After Submitting --------- Co-authored-by: amtoine --- toolkit.nu | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/toolkit.nu b/toolkit.nu index f4d2f92540..7e5a09c5ee 100644 --- a/toolkit.nu +++ b/toolkit.nu @@ -34,27 +34,19 @@ export def fmt [ export def clippy [ --verbose # print extra information about the command's progress --features: list # the list of features to run *Clippy* on - --workspace # run the *Clippy* command on the whole workspace (overrides `--features`) ] { if $verbose { print $"running ('toolkit clippy' | pretty-format-command)" } - try { - if $workspace {( - cargo clippy - --workspace - -- - -D warnings - -D clippy::unwrap_used - )} else {( - cargo clippy - --features ($features | str join ",") - -- - -D warnings - -D clippy::unwrap_used - )} - } catch { + try {( + cargo clippy + --workspace + --tests + --features ($features | str join ",") + -- + -D warnings + )} catch { error make --unspanned { msg: $"\nplease fix the above ('clippy' | pretty-format-command) errors before continuing!" }