Skip to content

Commit

Permalink
ref(nav): rename skim to no-recurse (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
plastikfan committed Feb 1, 2024
1 parent 3737e95 commit 3bac6c4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions xfs/nav/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ type resumeTE struct {

type cascadeTE struct {
naviTE
skim bool
depth uint
noRecurse bool
depth uint
}

type resumeTestProfile struct {
Expand Down
22 changes: 11 additions & 11 deletions xfs/nav/traverse-navigator-cascade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var _ = Describe("TraverseNavigatorCascade", Ordered, func() {
o.Notify.OnBegin = begin("🛡️")
o.Store.Subscription = entry.subscription
o.Callback = entry.callback
o.Store.Behaviours.Cascade.Skim = entry.skim
o.Store.Behaviours.Cascade.NoRecurse = entry.noRecurse
o.Store.Behaviours.Cascade.Depth = entry.depth
}

Expand All @@ -57,7 +57,7 @@ var _ = Describe("TraverseNavigatorCascade", Ordered, func() {

Entry(nil, &cascadeTE{
naviTE: naviTE{
message: "universal: Path contains folders only, skim",
message: "universal: Path contains folders only, no-recurse",
should: "traverse single level",
relative: "RETRO-WAVE",
subscription: nav.SubscribeAny,
Expand All @@ -67,12 +67,12 @@ var _ = Describe("TraverseNavigatorCascade", Ordered, func() {
folders: 4,
},
},
skim: true,
noRecurse: true,
}),

Entry(nil, &cascadeTE{
naviTE: naviTE{
message: "universal: Path contains files only, skim",
message: "universal: Path contains files only, no-recurse",
should: "traverse single level (containing files)",
relative: "RETRO-WAVE/Chromatics/Night Drive",
subscription: nav.SubscribeAny,
Expand All @@ -82,7 +82,7 @@ var _ = Describe("TraverseNavigatorCascade", Ordered, func() {
folders: 1,
},
},
skim: true,
noRecurse: true,
}),

Entry(nil, &cascadeTE{
Expand Down Expand Up @@ -134,7 +134,7 @@ var _ = Describe("TraverseNavigatorCascade", Ordered, func() {

Entry(nil, &cascadeTE{
naviTE: naviTE{
message: "universal: Path contains folders only, skim",
message: "universal: Path contains folders only, no-recurse",
should: "traverse single level",
relative: "RETRO-WAVE",
subscription: nav.SubscribeFolders,
Expand All @@ -144,12 +144,12 @@ var _ = Describe("TraverseNavigatorCascade", Ordered, func() {
folders: 4,
},
},
skim: true,
noRecurse: true,
}),

Entry(nil, &cascadeTE{
naviTE: naviTE{
message: "universal: Path contains files only, skim",
message: "universal: Path contains files only, no-recurse",
should: "traverse single level (containing files)",
relative: "RETRO-WAVE/Chromatics/Night Drive",
subscription: nav.SubscribeFolders,
Expand All @@ -159,7 +159,7 @@ var _ = Describe("TraverseNavigatorCascade", Ordered, func() {
folders: 1,
},
},
skim: true,
noRecurse: true,
}),

Entry(nil, &cascadeTE{
Expand Down Expand Up @@ -211,7 +211,7 @@ var _ = Describe("TraverseNavigatorCascade", Ordered, func() {

Entry(nil, &cascadeTE{
naviTE: naviTE{
message: "file: Path contains folders only, skim",
message: "file: Path contains folders only, no-recurse",
should: "traverse single level",
relative: "RETRO-WAVE/Chromatics/Night Drive",
subscription: nav.SubscribeFiles,
Expand All @@ -221,7 +221,7 @@ var _ = Describe("TraverseNavigatorCascade", Ordered, func() {
folders: 0,
},
},
skim: true,
noRecurse: true,
}),

Entry(nil, &cascadeTE{
Expand Down
8 changes: 4 additions & 4 deletions xfs/nav/traverse-options.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ type CascadeBehaviour struct {
//
Depth uint

// Skim is an alternative to using Depth, but limits the traversal
// NoRecurse is an alternative to using Depth, but limits the traversal
// to just the path specified by the user. Since the raison d'etre
// of the navigator is to recursively process a directory tree, using
// Skim would appear to be contrary to its natural behaviour. However
// NoRecurse would appear to be contrary to its natural behaviour. However
// there are clear usage scenarios where a client needs to process
// only the files in a specified directory.
//
Skim bool
NoRecurse bool
}

// NavigationBehaviours
Expand Down Expand Up @@ -306,7 +306,7 @@ func (o *TraverseOptions) afterUserOptions() {
noEach := o.Sampler.Custom.Each == nil && o.Sampler.Custom.While != nil
noWhile := o.Sampler.Custom.Each != nil && o.Sampler.Custom.While == nil

if o.Store.Behaviours.Cascade.Skim {
if o.Store.Behaviours.Cascade.NoRecurse {
o.Store.Behaviours.Cascade.Depth = 1
}

Expand Down

0 comments on commit 3bac6c4

Please sign in to comment.