Home / Function/ add_child_path() — tailwindcss Function Reference

add_child_path() — tailwindcss Function Reference

Architecture documentation for the add_child_path() function in dir.rs from the tailwindcss codebase.

Function rust Oxide PreProcessors calls 2 called by 2

Entity Profile

Dependency Diagram

graph TD
  855cb886_6757_8d3a_1a48_e3c2290b323b["add_child_path()"]
  a558c8e1_3e7c_59d2_b113_bacec65ba188["dir.rs"]
  855cb886_6757_8d3a_1a48_e3c2290b323b -->|defined in| a558c8e1_3e7c_59d2_b113_bacec65ba188
  f704589e_68db_601b_f96b_2d1fcf26e7d3["add_parents()"]
  f704589e_68db_601b_f96b_2d1fcf26e7d3 -->|calls| 855cb886_6757_8d3a_1a48_e3c2290b323b
  e98d4cd2_6820_4001_f485_b7bd568700a1["add_child()"]
  e98d4cd2_6820_4001_f485_b7bd568700a1 -->|calls| 855cb886_6757_8d3a_1a48_e3c2290b323b
  3c179894_d0f2_ab15_e1e4_19a7d6e99043["create_gitignore()"]
  855cb886_6757_8d3a_1a48_e3c2290b323b -->|calls| 3c179894_d0f2_ab15_e1e4_19a7d6e99043
  6c64d24a_ed0f_82d5_3a35_0ae164296494["resolve_git_commondir()"]
  855cb886_6757_8d3a_1a48_e3c2290b323b -->|calls| 6c64d24a_ed0f_82d5_3a35_0ae164296494
  style 855cb886_6757_8d3a_1a48_e3c2290b323b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

crates/ignore/src/dir.rs lines 249–336

    fn add_child_path(&self, dir: &Path) -> (IgnoreInner, Option<Error>) {
        let git_type =
            if self.0.opts.require_git && (self.0.opts.git_ignore || self.0.opts.git_exclude) {
                dir.join(".git").metadata().ok().map(|md| md.file_type())
            } else {
                None
            };
        let has_git = git_type.is_some() || dir.join(".jj").exists();

        let mut errs = PartialErrorBuilder::default();
        let custom_ig_matcher = if self.0.custom_ignore_filenames.is_empty() {
            Gitignore::empty()
        } else {
            let (m, err) = create_gitignore(
                &dir,
                &dir,
                &self.0.custom_ignore_filenames,
                self.0.opts.ignore_case_insensitive,
            );
            errs.maybe_push(err);
            m
        };
        let ig_matcher = if !self.0.opts.ignore {
            Gitignore::empty()
        } else {
            let (m, err) = create_gitignore(
                &dir,
                &dir,
                &[".ignore"],
                self.0.opts.ignore_case_insensitive,
            );
            errs.maybe_push(err);
            m
        };
        let gi_matcher = if !self.0.opts.git_ignore {
            Gitignore::empty()
        } else {
            let (m, err) = create_gitignore(
                &dir,
                &dir,
                &[".gitignore"],
                self.0.opts.ignore_case_insensitive,
            );
            errs.maybe_push(err);
            m
        };

        let gi_exclude_matcher = if !self.0.opts.git_exclude {
            Gitignore::empty()
        } else {
            match resolve_git_commondir(dir, git_type) {
                Ok(git_dir) => {
                    let (m, err) = create_gitignore(
                        &dir,
                        &git_dir,
                        &["info/exclude"],
                        self.0.opts.ignore_case_insensitive,
                    );
                    errs.maybe_push(err);
                    m
                }
                Err(err) => {
                    errs.maybe_push(err);
                    Gitignore::empty()
                }
            }
        };
        let ig = IgnoreInner {
            compiled: self.0.compiled.clone(),
            dir: dir.to_path_buf(),
            overrides: self.0.overrides.clone(),
            types: self.0.types.clone(),
            parent: Some(self.clone()),
            is_absolute_parent: false,
            absolute_base: self.0.absolute_base.clone(),
            global_gitignores_relative_to: self.0.global_gitignores_relative_to.clone(),
            explicit_ignores: self.0.explicit_ignores.clone(),
            custom_ignore_filenames: self.0.custom_ignore_filenames.clone(),
            custom_ignore_matcher: custom_ig_matcher,
            ignore_matcher: ig_matcher,
            git_global_matcher: self.0.git_global_matcher.clone(),

Domain

Subdomains

Frequently Asked Questions

What does add_child_path() do?
add_child_path() is a function in the tailwindcss codebase, defined in crates/ignore/src/dir.rs.
Where is add_child_path() defined?
add_child_path() is defined in crates/ignore/src/dir.rs at line 249.
What does add_child_path() call?
add_child_path() calls 2 function(s): create_gitignore, resolve_git_commondir.
What calls add_child_path()?
add_child_path() is called by 2 function(s): add_child, add_parents.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free