Home / Function/ create_gitignore() — tailwindcss Function Reference

create_gitignore() — tailwindcss Function Reference

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

Function rust Oxide Scanner calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  3c179894_d0f2_ab15_e1e4_19a7d6e99043["create_gitignore()"]
  a558c8e1_3e7c_59d2_b113_bacec65ba188["dir.rs"]
  3c179894_d0f2_ab15_e1e4_19a7d6e99043 -->|defined in| a558c8e1_3e7c_59d2_b113_bacec65ba188
  855cb886_6757_8d3a_1a48_e3c2290b323b["add_child_path()"]
  855cb886_6757_8d3a_1a48_e3c2290b323b -->|calls| 3c179894_d0f2_ab15_e1e4_19a7d6e99043
  767f0d1d_ed6b_2d39_ea17_d569e763e1dc["build()"]
  3c179894_d0f2_ab15_e1e4_19a7d6e99043 -->|calls| 767f0d1d_ed6b_2d39_ea17_d569e763e1dc
  style 3c179894_d0f2_ab15_e1e4_19a7d6e99043 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

crates/ignore/src/dir.rs lines 812–847

pub(crate) fn create_gitignore<T: AsRef<OsStr>>(
    dir: &Path,
    dir_for_ignorefile: &Path,
    names: &[T],
    case_insensitive: bool,
) -> (Gitignore, Option<Error>) {
    let mut builder = GitignoreBuilder::new(dir);
    let mut errs = PartialErrorBuilder::default();
    builder.case_insensitive(case_insensitive).unwrap();
    for name in names {
        let gipath = dir_for_ignorefile.join(name.as_ref());
        // This check is not necessary, but is added for performance. Namely,
        // a simple stat call checking for existence can often be just a bit
        // quicker than actually trying to open a file. Since the number of
        // directories without ignore files likely greatly exceeds the number
        // with ignore files, this check generally makes sense.
        //
        // However, until demonstrated otherwise, we speculatively do not do
        // this on Windows since Windows is notorious for having slow file
        // system operations. Namely, it's not clear whether this analysis
        // makes sense on Windows.
        //
        // For more details: https://github.com/BurntSushi/ripgrep/pull/1381
        if cfg!(windows) || gipath.exists() {
            errs.maybe_push_ignore_io(builder.add(gipath));
        }
    }
    let gi = match builder.build() {
        Ok(gi) => gi,
        Err(err) => {
            errs.push(err);
            GitignoreBuilder::new(dir).build().unwrap()
        }
    };
    (gi, errs.into_error_option())
}

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free