Skip to content

flake: split test shell#27

Closed
amaanq wants to merge 69 commits into
mainfrom
test-shell
Closed

flake: split test shell#27
amaanq wants to merge 69 commits into
mainfrom
test-shell

Conversation

@amaanq

@amaanq amaanq commented Jun 28, 2026

Copy link
Copy Markdown
Member

No description provided.

atagen and others added 30 commits May 28, 2026 01:25
Otherwise we get this:
```
 cd cade
cade: loaded /home/jam/projects/cade.
Error: nu::shell::error

  × Error while parsing JSON text
    ╭─[/nix/store/yaiwb1152gdsdnmrajzg8k2xpqqpcqdx-cade-hook-nu:18:31]
 17 │                     let prog = ("let __pre = $env\n" + $m.h + "\nlet __post = $env\nlet __set = ($__post | transpose k v | where
 18 │                     let d = (^$nu_exe --no-config-file --commands $prog | from json)
    ·                               ───┬───
    ·                                  ╰── error parsing JSON text
 19 │                     load-env $d.set
    ╰────
  ╰─▶ nu::shell::outsidespan

        × Error while parsing JSON text
         ╭─[2:1]
       1 │ hello
       2 │ {
         · ▲
         · ╰── "trailing characters" at line 2 column 1
       3 │   "set": {},
         ╰────
```

With `hook load print "hello"` in our config file. Setting env vars like
`ENV=var` also seemed to be affected it.

Signed-off-by: PlumJam <git@plumj.am>
Co-authored-by: Amaan Qureshi <git@amaanq.com>
Co-authored-by: Amaan Qureshi <git@amaanq.com>
Co-authored-by: Amaan Qureshi <git@amaanq.com>
Previously disallow was ignored if no .cade files were changed (not
stale) so revoking permission didn't trigger reload.

Works when any member of a chain is disallowed and updates as needed
when shell hook runs again.

Signed-off-by: PlumJam <git@plumj.am>
When walking the ancestor chain, a `.cade` that fails to parse now caps
the cascade at that dir instead of being silently climbed past to a valid
parent. This keeps the chain-shape decision aligned with activation, which
re-reads the same file via `config_keywords` and surfaces the parse error
there: without the cap, chain construction would build a shape that quietly
ignored a broken `.cade`, then activation would fail (or compose a parent
the user never expected) on the very same file.

The cap reuses the single per-dir parse already performed for `disinherit`
detection (`caps_the_cascade`), so no extra read is introduced. Behavior is
identical to disinherit's cap: the malformed dir itself still joins as the
chain root (its error surfaces at load), and gap-fill anchors on it without
ever reaching above.

Split out of the disinherit feature commit so this policy change lands with
its own rationale and tests.
@amaanq

amaanq commented Jun 28, 2026

Copy link
Copy Markdown
Member Author

i hate github

@amaanq amaanq deleted the test-shell branch June 28, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants