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

Entity Profile

Dependency Diagram

graph TD
  85a07ccd_8d36_b2b7_e048_c40326822cad["add_child_path()"]
  510a4ebc_9a2a_672a_2d6d_a56dabd1134b["dir.rs"]
  85a07ccd_8d36_b2b7_e048_c40326822cad -->|defined in| 510a4ebc_9a2a_672a_2d6d_a56dabd1134b
  54b22d2f_3aaa_d065_0cd7_db53eddaeeff["add_parents()"]
  54b22d2f_3aaa_d065_0cd7_db53eddaeeff -->|calls| 85a07ccd_8d36_b2b7_e048_c40326822cad
  5f1e446c_b1a6_cd2c_2707_77480f9eaad4["add_child()"]
  5f1e446c_b1a6_cd2c_2707_77480f9eaad4 -->|calls| 85a07ccd_8d36_b2b7_e048_c40326822cad
  08ad47d0_2720_5cb6_28b0_3da92e4a4b55["create_gitignore()"]
  85a07ccd_8d36_b2b7_e048_c40326822cad -->|calls| 08ad47d0_2720_5cb6_28b0_3da92e4a4b55
  27ac4d0f_c908_3282_6a22_e7a8f7917e92["resolve_git_commondir()"]
  85a07ccd_8d36_b2b7_e048_c40326822cad -->|calls| 27ac4d0f_c908_3282_6a22_e7a8f7917e92
  style 85a07ccd_8d36_b2b7_e048_c40326822cad 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