create_gitignore() — tailwindcss Function Reference
Architecture documentation for the create_gitignore() function in dir.rs from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD e08d8e7a_18b6_456a_1d14_5093e56e79a8["create_gitignore()"] 00fde01e_208e_84d9_5445_fec3bcf2125f["add_child_path()"] 00fde01e_208e_84d9_5445_fec3bcf2125f -->|calls| e08d8e7a_18b6_456a_1d14_5093e56e79a8 f9057141_74ef_29d7_b851_a214bdc6bfa9["build()"] e08d8e7a_18b6_456a_1d14_5093e56e79a8 -->|calls| f9057141_74ef_29d7_b851_a214bdc6bfa9 style e08d8e7a_18b6_456a_1d14_5093e56e79a8 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
Source
Frequently Asked Questions
What does create_gitignore() do?
create_gitignore() is a function in the tailwindcss codebase.
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