bolt/glob.bend checks
raw source on the hub · import 0x729eecea86ea5a2cdba3a2856a313bca/bolt/glob.bend as Glob
bolt/glob: what bolt lints when it is handed no files: every .bend file
under a directory, sorted. A hidden name (.git, .gate, .scratch,
.claude) and node_modules are not descended into. The walk keeps a queue
of directories rather than nesting, as Bend has no mutual recursion: one def
shrinks one argument, the fuel, which bounds how many directories are read.
2 imports
import Base import ./walk/service.bend as Walk
Definitions
def skipped source · line 10 · raw
@+name:String -> Bool
a directory bolt never descends into
def bare source · line 14 · raw
@+name:String -> String
an entry's name without the "/" that marks it a directory
def under source · line 18 · raw
@+dir:String -> @+name:String -> String
a name directly under a directory, as a path
def dirs source · line 22 · raw
@es:List<&2, String> -> @+dir:String -> List<&2, String>
the sub-directories of a listing worth descending into, as paths
def bends source · line 32 · raw
@es:List<&2, String> -> @+dir:String -> List<&2, String>
the .bend files of a listing, as paths (a directory's name ends in "/")
Templates
template walk source · line 43 · raw
@-w:0x729eecea86ea5a2cdba3a2856a313bca/bolt/walk/service.Walk -> @fuel:Nat -> @queue:List<&2, String> -> @acc:List<&2, String> -> IO(List<&2, String>)
every .bend file under the directories still queued, the fuel bounding how
many directories are read. What is found is put in front of what came before,
not after it, so the walk stays linear; find sorts at the end regardless.
template find source · line 58 · raw
@-w:0x729eecea86ea5a2cdba3a2856a313bca/bolt/walk/service.Walk -> @dir:String -> IO(List<&2, String>)
every .bend file under a directory, sorted