Skip to main content

Module exclude

Module exclude 

Source
Expand description

Shared default exclusion lists and matcher (ADR-010).

One source of truth for CLI, FUSE/mount, library IndexerConfig, and docs. Hidden files and hidden directories under the index root are excluded by default. A separate secret-file denylist is always applied unless the user sets include_secret_files. Gitignore ! rules cannot re-include a secret or hidden path.

Built-in secret patterns follow gitleaks / TruffleHog-style filename denylists (*.pem, *.key, id_rsa / id_ed25519, credentials files, .netrc, .npmrc, .pypirc, .env*, kube config). A bare id_* is intentionally not used (false positive on id_mapping.md).

Hidden/secret path exclusion is adapted from sophie4869/ragfs onto the ignore crate (WalkBuilder + OverrideBuilder) as specified by ADR-010. Nested .ragfsignore files are supported under the index root.

Re-exportsยง

use ignore::WalkBuilder; ๐Ÿ”’
use ignore::gitignore::Gitignore; ๐Ÿ”’
use ignore::overrides::Override; ๐Ÿ”’
use ignore::overrides::OverrideBuilder; ๐Ÿ”’
use std::path::Component; ๐Ÿ”’
use std::path::Path; ๐Ÿ”’
use std::path::PathBuf; ๐Ÿ”’
use tracing::warn; ๐Ÿ”’
use crate::indexer::path_matches_pattern; ๐Ÿ”’

Structsยง

ExclusionMatcher
Matcher bound to one index root.
ExclusionOptions
Options for ExclusionMatcher.

Constantsยง

DEFAULT_NOISE_PATTERNS
Noise / build-artifact globs used as the default [index].exclude list.
DEFAULT_SECRET_PATTERNS
Secret-file denylist (ADR-010). Always applied unless include_secret_files.

Functionsยง

add_ignore_override ๐Ÿ”’
Add an ignore override (!glob).
build_overrides ๐Ÿ”’
default_exclude_patterns
Default [index].exclude / IndexerConfig.exclude_patterns (noise only).
gitignore_excludes ๐Ÿ”’
Honour .gitignore / .ignore from the index root down to path.
is_hidden_component ๐Ÿ”’
is_hidden_under_root ๐Ÿ”’
matches_include ๐Ÿ”’
override_ignores ๐Ÿ”’
path_for_override ๐Ÿ”’