Skip to content
Snippets Groups Projects
Commit f2a76fbb authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

check Nushell files in the CI (!137)

in order to help catch issues with the various Nushell scripts and modules in the source base, i propose to add a CI script that will check them all.

below is an example error, e.g. when introducing a syntax error in `.env.nu`:
```
Error:   × Failed to parse content:
  │     file: .env.nu
  │     err:  Expected keyword.
```
parent 07602875
Branches
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@ fmt:
cargo fmt --all
check:
nu scripts/check-nushell-files.nu
cargo check --workspace --all-targets
cargo check --workspace --all-targets --features kzg
cargo check --workspace --all-targets --features aplonk
......
let files = ^git lf | lines | where { ($in | path parse).extension == "nu" }
for f in $files {
let path = $env.FILE_PWD | path dirname | path join $f
try {
nu-check $path --debug
} catch { |e|
let err = $e.debug
| ansi strip
| parse --regex '(.*)msg: "Found : (?<msg>.*)", span: (?<span>.*)'
| into record
error make --unspanned {
msg: ([
$"(ansi red_bold)($e.msg)(ansi reset):",
$" file: (ansi purple)($f)(ansi reset)",
$" err: ($err.msg)",
] | str join "\n")
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment