markon-core 0.15.13

markon core - Mark it on.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::path::Path;

/// Render a path with forward slashes regardless of platform.
pub(crate) fn path_to_forward_slash(rel: &Path) -> String {
    rel.components()
        .map(|c| c.as_os_str().to_string_lossy().into_owned())
        .collect::<Vec<_>>()
        .join("/")
}

/// Default ignore-rule walker that respects `.gitignore`, `.ignore`, and
/// hidden-file conventions. This is the shared baseline for workspace reads
/// that should behave like the chat tools and ripgrep.
pub(crate) fn default_walker(root: &Path) -> ignore::WalkBuilder {
    let mut b = ignore::WalkBuilder::new(root);
    b.standard_filters(true);
    b
}