From 6cbd42974b3dbab7a465cd36523676a8c63f42c8 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Fri, 12 May 2023 12:03:51 -0500 Subject: [PATCH] add dataframe support to toolkit (#9173) # Description This PR allows you to pass `--dataframe` into `toolkit check pr --fast --dataframe` in order to check and build with the dataframe feature. # User-Facing Changes # Tests + Formatting # After Submitting --- toolkit.nu | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/toolkit.nu b/toolkit.nu index 404cd4ad38..3de2091eae 100644 --- a/toolkit.nu +++ b/toolkit.nu @@ -31,13 +31,18 @@ export def fmt [ # > it is important to make `clippy` happy :relieved: export def clippy [ --verbose: bool # print extra information about the command's progress + --dataframe: bool # use the dataframe feature ] { if $verbose { print $"running ('toolkit clippy' | pretty-print-command)" } try { - cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect -A clippy::result_large_err + if $dataframe { + cargo clippy --workspace --features=dataframe -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect -A clippy::result_large_err + } else { + cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect -A clippy::result_large_err + } } catch { error make -u { msg: $"\nplease fix the above ('clippy' | pretty-print-command) errors before continuing!" } } @@ -46,9 +51,14 @@ export def clippy [ # check that all the tests pass export def test [ --fast: bool # use the "nextext" `cargo` subcommand to speed up the tests (see [`cargo-nextest`](https://nexte.st/) and [`nextest-rs/nextest`](https://github.com/nextest-rs/nextest)) + --dataframe: bool # use the dataframe feature ] { - if ($fast) { - cargo nextest --workspace + if ($fast and $dataframe) { + cargo nextest run --all --features=dataframe + } else if ($fast) { + cargo nextest run --all + } else if ($dataframe) { + cargo test --workspace --features=dataframe } else { cargo test --workspace } @@ -198,6 +208,7 @@ def report [ # now the whole `toolkit check pr` passes! :tada: export def "check pr" [ --fast: bool # use the "nextext" `cargo` subcommand to speed up the tests (see [`cargo-nextest`](https://nexte.st/) and [`nextest-rs/nextest`](https://github.com/nextest-rs/nextest)) + --dataframe: bool # use the dataframe feature ] { let-env NU_TEST_LOCALE_OVERRIDE = 'en_US.utf8'; try { @@ -207,14 +218,24 @@ export def "check pr" [ } try { - clippy --verbose + if $dataframe { + clippy --dataframe --verbose + } else { + clippy --verbose + } } catch { return (report --fail-clippy) } print $"running ('toolkit test' | pretty-print-command)" try { - if $fast { test --fast } else { test } + if $fast and $dataframe { + test --fast --dataframe + } else if $fast { + test --fast + } else { + test + } } catch { return (report --fail-test) }