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.

Entity Profile

Dependency Diagram

graph TD
  708ca884_a2b4_b556_4c28_c03a22aa3c1f["add_child_path()"]
  53fcda14_433d_b98d_8ccd_5c1f3bb4d3c8["add_parents()"]
  53fcda14_433d_b98d_8ccd_5c1f3bb4d3c8 -->|calls| 708ca884_a2b4_b556_4c28_c03a22aa3c1f
  7f3cd9fa_fc0e_11d8_c82c_d766c339923a["add_child()"]
  7f3cd9fa_fc0e_11d8_c82c_d766c339923a -->|calls| 708ca884_a2b4_b556_4c28_c03a22aa3c1f
  318d96e1_38a0_5e31_13ec_1f2b2e0039bc["create_gitignore()"]
  708ca884_a2b4_b556_4c28_c03a22aa3c1f -->|calls| 318d96e1_38a0_5e31_13ec_1f2b2e0039bc
  631676a3_08b2_b1c8_e27f_4b73d723b72b["resolve_git_commondir()"]
  708ca884_a2b4_b556_4c28_c03a22aa3c1f -->|calls| 631676a3_08b2_b1c8_e27f_4b73d723b72b
  style 708ca884_a2b4_b556_4c28_c03a22aa3c1f 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())
    }

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