Repository navigation
docs(nushell): address review findings on the conventions - #22
Merged
Merged
Conversation
State the stream trap as a general pattern with `collect` as the remedy, move the syntax and environment traps into their own sections, and fix the quoting example, test-file naming, and the timestamp rationale.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The nushell skill's stream trap now states the general pattern behind it, the traps gain a top-level syntax section and a separate environment section, and several examples and labels match the skill's own rules.
exitorerror make, withget <n>,last,skip,drop, andselectas examples. It keeps the nushell/nushell#19463 link, points to nushell/nushell#19467 for the full list of affected commands, and addscollectbefore the command as the way to surface the error, whilefirststays the way to take a single match.into datetime --format "%s"uses double quotes, as the skill's quoting rule asks. The remaining single-quoted examples hold a backslash (the regex piece), name the$'...'syntax, or show script arguments as shell input.### Syntaxnow opens the traps,### Parsing and databecomes### Data and typeswith its#### Streams and commandsrenamed to#### Commands, and the$nu.home-dirtrap moves into its own### Environmentafter External commands.<name>.test.nu, matching the runner's<name>.stub.nu, and its subsection becomes "Files and assertions".use ./paths.nu [path-split path-label].TZfor the child process, since the running Nushell reads its zone only at startup.Bump hakula-languages to 1.0.7.
Test plan
nix develop -c run-hooksnix flake check --all-systemsclaude plugin validate .mk nas[1 2 3] | each {|x| if $x == n { error make {msg: boom} } else { $x } },mk 3 | drop 1,mk 1 | select 1,mk 1 | skip 1,mk 1 | get 2,mk 1 | last,mk 1 | last 2, andmk 1 | drop nth 0print results and exit 0, whilemk 1 | collect | skip 1,mk 3 | collect | drop 1, andmk 1 | collect | lastraiseboom+0800,$env.TZ = "Asia/Tokyo"andwith-env {TZ: "Asia/Tokyo"} { date now | format date "%z" }still print+0800in-process, while a child^$nu.current-exeunder the samewith-envprints+0900