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 RustCore PreProcessors calls 2 called by 2

Entity Profile

Dependency Diagram

graph TD
  00fde01e_208e_84d9_5445_fec3bcf2125f["add_child_path()"]
  6ce8c6d0_aa87_a200_fbf4_912453c675b1["add_parents()"]
  6ce8c6d0_aa87_a200_fbf4_912453c675b1 -->|calls| 00fde01e_208e_84d9_5445_fec3bcf2125f
  7d9549d0_d5cc_b7c3_b367_0249f8430d02["add_child()"]
  7d9549d0_d5cc_b7c3_b367_0249f8430d02 -->|calls| 00fde01e_208e_84d9_5445_fec3bcf2125f
  e08d8e7a_18b6_456a_1d14_5093e56e79a8["create_gitignore()"]
  00fde01e_208e_84d9_5445_fec3bcf2125f -->|calls| e08d8e7a_18b6_456a_1d14_5093e56e79a8
  09a5f4e6_d619_7ccf_c7d6_95d2d60e1257["resolve_git_commondir()"]
  00fde01e_208e_84d9_5445_fec3bcf2125f -->|calls| 09a5f4e6_d619_7ccf_c7d6_95d2d60e1257
  style 00fde01e_208e_84d9_5445_fec3bcf2125f 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(),
            git_ignore_matcher: gi_matcher,
            git_exclude_matcher: gi_exclude_matcher,
            has_git,
            opts: self.0.opts,
        };
        (ig, errs.into_error_option())
    }

Domain

Subdomains

Frequently Asked Questions

What does add_child_path() do?
add_child_path() is a function in the tailwindcss codebase.
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