Skip to main content

Module discovery

Module discovery 

Source
Expand description

Shared markdown file discovery semantics.

The CLI walker (file_processor::discovery in the binary crate) and the LSP workspace index scanner answer the same question: which files does rumdl process here? The pieces of that answer that must never diverge live in this module:

  • the markdown extension set and how it is matched,
  • the final source-kind gate for each adapter’s capabilities,
  • how ignore-file handling (.gitignore, .markdownlintignore, hidden entries) is configured on a walker,
  • how exclude patterns from config are expanded and matched.

Callers still differ deliberately: the LSP skips .git/node_modules/ target outright as an editor-performance safety net, while the CLI walks whatever gitignore semantics allow.

Structs§

ExcludeMatchers
Compiled exclude patterns with directory-pattern expansion applied.
ExplicitIncludeMatchers
Compiled matchers for the explicitly-named files in a set of config include patterns (see explicit_file_name_glob).
LintablePathSelector
The shared final gate for files yielded by CLI and LSP discovery walks.
MarkdownWalkOptions
Ignore-handling options applied to a markdown discovery walk.
MarkdownWorkspaceScan
A complete, configured Markdown workspace scan.
PathAliases
Alternative spellings of a path, implied by the absolute patterns in a configuration.

Enums§

LintableFileMode
Source kinds an adapter can interpret after a path passes include matching.

Constants§

MARKDOWN_EXTENSIONS
File extensions rumdl treats as markdown, lowercase.

Functions§

any_case_extension_glob
A glob selecting ext in any letter case, as *.[mM][dD] for md.
apply_markdown_walk_options
Apply the shared ignore-handling configuration to a walker over roots.
canonicalize_for_matching
Canonicalize path for pattern matching, or None when it cannot be resolved (a missing or unreadable file).
exclude_override_rule
The ignore override rule that excludes pattern.
exclude_pattern_compiles
Whether every glob an exclude pattern turns into compiles.
expand_directory_pattern
Expands directory-style patterns to also match files within them. Pattern “dir/path” becomes [“dir/path”, “dir/path/**”] to match both the directory itself and all contents recursively. A leading ~ is expanded first (see expand_home_prefix).
expand_home_prefix
Expand a leading ~ in a path pattern to the user’s home directory, so a user-level config (~/.config/rumdl/rumdl.toml) can name a home path without hardcoding a username.
explicit_file_name_glob
The file-name glob of an include pattern that explicitly names files, if it does.
has_absolute_spelling
Whether pattern names an absolute location in any of its spellings.
has_markdown_extension
Whether path has a markdown extension.
include_pattern_compiles
Whether an include pattern compiles as a walker override.
is_absolute_pattern
Whether pattern names an absolute location. A leading / counts on every platform: patterns use / separators, so a Unix-style path stays absolute when the same config is read on Windows.
is_markdown_extension
Whether ext is a markdown extension. Matches case-insensitively so conventional variants like Rmd (and shouting-case MD) qualify.
markdown_walk_builder
Build a walker over root configured with the shared options.
normalize_pattern_for_base
Normalize a config path pattern for matching against paths discovered under base: expand a leading ~, then rewrite an absolute pattern as one relative to base when base contains it.
path_relative_to
Relativize path against base for exclude-pattern matching, canonicalizing both sides so symlinks (e.g. macOS /tmp) and Windows path-representation differences don’t defeat the prefix strip. Returns None when path is not under base.
stops_at_repository_root
Whether a walk over roots stops reading gitignores at the repository root.