tvl-depot/nix/readTree/tests
Vincent Ambo 44a5e14200 feat(nix/readTree): implement .skip-tree marker for subtree ignoring
With this change, readTree gains the ability to notice a `.skip-tree`
marker in addition to the `.skip-subtree` marker.

The behaviour of the new marker will completely ignore the folder that
the marker is located in (i.e. no node will be present for it in the
parent at all).

To make this work, the recursive function in readTree had to be
modified to return a sentinel value (noting that a tree has requested
to be skipped) which is then filtered out when constructing the list
of children. The actual `readTree` function is now a wrapper around
this inner, sentinel-yielding implementation which unwraps the result
set.

For obvious reasons, `.skip-tree` is not allowed at the top-level and
readTree will throw an error if it encounters it there.

Fixes: b/244
Change-Id: Ica731bc1af356e881fd3d31c7109f62ffd2762ea
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8185
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
2023-02-28 12:15:33 +00:00
..
test-example feat(nix/readTree): add tests of the README example 2021-01-30 12:06:54 +00:00
test-marker style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
test-tree-traversal feat(nix/readTree): implement .skip-tree marker for subtree ignoring 2023-02-28 12:15:33 +00:00
test-wrong-no-dots feat(nix/readTree): give better error message when not a function 2021-02-19 23:04:04 +00:00
test-wrong-not-a-function feat(nix/readTree): give better error message when not a function 2021-02-19 23:04:04 +00:00
.skip-subtree feat(nix/readTree): add tests of the README example 2021-01-30 12:06:54 +00:00
default.nix feat(nix/readTree): implement .skip-tree marker for subtree ignoring 2023-02-28 12:15:33 +00:00