From 0756c37097dc8ef3091fe69950592dcba19edbc7 Mon Sep 17 00:00:00 2001 From: J R M Date: Mon, 30 Mar 2026 19:58:14 +0200 Subject: [PATCH] bump version and fix warnings and errors --- .github/workflows/test.yml | 7 +++---- exercises/practice/forth/.meta/example.nu | 3 ++- exercises/practice/resistor-color-duo/.meta/example.nu | 4 ++-- .../practice/resistor-color-trio/.meta/example.nu | 10 +++++----- exercises/practice/resistor-color/.meta/example.nu | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bf708ac..bed7a7c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,6 @@ on: jobs: verify_exercises: - # apk has an old nu version, so alpine is used to ensure compatibility runs-on: ubuntu-24.04 steps: @@ -22,11 +21,11 @@ jobs: - name: Use nushell run: | - curl -L -o nu.tar.gz https://github.com/nushell/nushell/releases/download/0.104.1/nu-0.104.1-x86_64-unknown-linux-gnu.tar.gz && \ + curl -L -o nu.tar.gz https://github.com/nushell/nushell/releases/download/0.111.0/nu-0.111.0-x86_64-unknown-linux-gnu.tar.gz && \ tar -xzf nu.tar.gz && \ - sudo mv nu-0.104.1-x86_64-unknown-linux-gnu/* /usr/bin/ && \ + sudo mv nu-0.111.0-x86_64-unknown-linux-gnu/* /usr/bin/ && \ rm nu.tar.gz && \ - rm -r nu-0.104.1-x86_64-unknown-linux-gnu + rm -r nu-0.111.0-x86_64-unknown-linux-gnu - name: Verify all exercises diff --git a/exercises/practice/forth/.meta/example.nu b/exercises/practice/forth/.meta/example.nu index dbac307..b6aece3 100644 --- a/exercises/practice/forth/.meta/example.nu +++ b/exercises/practice/forth/.meta/example.nu @@ -1,3 +1,4 @@ +alias find = find -n def macro? [item] { let trimmed = ($item | str trim) ($trimmed | find --regex "^:\\s+[^\\s]+\\s+.+\\s+;$") == $trimmed @@ -168,4 +169,4 @@ export def evaluate [instructions: list] { $stack = perform $stack $norm } $stack -} \ No newline at end of file +} diff --git a/exercises/practice/resistor-color-duo/.meta/example.nu b/exercises/practice/resistor-color-duo/.meta/example.nu index 18ce8fe..be654d7 100644 --- a/exercises/practice/resistor-color-duo/.meta/example.nu +++ b/exercises/practice/resistor-color-duo/.meta/example.nu @@ -1,10 +1,10 @@ def color_code [color] { [black brown red orange yellow green blue violet grey white] | enumerate - | filter {|item| $item.item == $color} + | where $it.item == $color | get index | get 0 } export def value [colors] { (color_code $colors.0) * 10 + (color_code $colors.1) -} \ No newline at end of file +} diff --git a/exercises/practice/resistor-color-trio/.meta/example.nu b/exercises/practice/resistor-color-trio/.meta/example.nu index 0d4938c..1b53342 100644 --- a/exercises/practice/resistor-color-trio/.meta/example.nu +++ b/exercises/practice/resistor-color-trio/.meta/example.nu @@ -1,7 +1,7 @@ def color_code [color] { [black brown red orange yellow green blue violet grey white] | enumerate - | filter {|item| $item.item == $color} + | where $it.item == $color | get index | get 0 } @@ -14,13 +14,13 @@ def unit [] { if $ohms < 1_000 { $"($ohms) ohms" } else if $ohms < 1_000_000 { - $"($ohms / 1_000) kiloohms" + $"($ohms // 1_000) kiloohms" } else if $ohms < 1_000_000_000 { - $"($ohms / 1_000_000) megaohms" + $"($ohms // 1_000_000) megaohms" } else { - $"($ohms / 1_000_000_000) gigaohms" + $"($ohms // 1_000_000_000) gigaohms" } } export def label [colors] { (value $colors) * 10 ** ((color_code $colors.2)) | unit -} \ No newline at end of file +} diff --git a/exercises/practice/resistor-color/.meta/example.nu b/exercises/practice/resistor-color/.meta/example.nu index 2603a82..2da06ef 100644 --- a/exercises/practice/resistor-color/.meta/example.nu +++ b/exercises/practice/resistor-color/.meta/example.nu @@ -1,7 +1,7 @@ export def color_code [color] { - colors | enumerate | filter {|item| $item.item == $color} | get index | get 0 + colors | enumerate | where $it.item == $color | get index | get 0 } export def colors [] { [black brown red orange yellow green blue violet grey white] -} \ No newline at end of file +}