Skip to main content

Module walker

Module walker 

Source
Expand description

File discovery with glob patterns and layered ignore rules.

Walks a project tree and returns the files that should be part of the context or index, honoring (in order): hidden-file rules, .gitignore at all levels, .ignore, .contextignore, ctx’s built-in ignore list (170+ patterns), and any custom include/ignore globs.

The main entry point is discover_files with a WalkerConfig; FileFilter offers the same rules as a reusable per-file check (used by watch mode).

Structs§

FileEntry
Represents a discovered file with its metadata.
FileFilter
File filter that can check if individual files should be included. This is built once and reused for watch mode filtering.
WalkerConfig
Configuration for the file walker.

Functions§

discover_files
Walk directories and discover files based on configuration.
format_size
Format file size in human-readable format.