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 OxideEngine Scanner calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  08ad47d0_2720_5cb6_28b0_3da92e4a4b55["create_gitignore()"]
  510a4ebc_9a2a_672a_2d6d_a56dabd1134b["dir.rs"]
  08ad47d0_2720_5cb6_28b0_3da92e4a4b55 -->|defined in| 510a4ebc_9a2a_672a_2d6d_a56dabd1134b
  85a07ccd_8d36_b2b7_e048_c40326822cad["add_child_path()"]
  85a07ccd_8d36_b2b7_e048_c40326822cad -->|calls| 08ad47d0_2720_5cb6_28b0_3da92e4a4b55
  ea4007ac_a311_c454_45f6_4e3ba7192b1a["build()"]
  08ad47d0_2720_5cb6_28b0_3da92e4a4b55 -->|calls| ea4007ac_a311_c454_45f6_4e3ba7192b1a
  style 08ad47d0_2720_5cb6_28b0_3da92e4a4b55 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