matched_ignore() — tailwindcss Function Reference
Architecture documentation for the matched_ignore() function in dir.rs from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 32dda52f_c3c3_2a3a_6d2d_350dc7a63291["matched_ignore()"] 510a4ebc_9a2a_672a_2d6d_a56dabd1134b["dir.rs"] 32dda52f_c3c3_2a3a_6d2d_350dc7a63291 -->|defined in| 510a4ebc_9a2a_672a_2d6d_a56dabd1134b df4238ce_ff67_ee56_17ce_54ac1d2fa297["matched()"] df4238ce_ff67_ee56_17ce_54ac1d2fa297 -->|calls| 32dda52f_c3c3_2a3a_6d2d_350dc7a63291 c67df4fc_bab2_beea_3466_6b812f0bd2d4["parents()"] 32dda52f_c3c3_2a3a_6d2d_350dc7a63291 -->|calls| c67df4fc_bab2_beea_3466_6b812f0bd2d4 14813cf8_2961_635e_7e00_2170620f1147["absolute_base()"] 32dda52f_c3c3_2a3a_6d2d_350dc7a63291 -->|calls| 14813cf8_2961_635e_7e00_2170620f1147 df4238ce_ff67_ee56_17ce_54ac1d2fa297["matched()"] 32dda52f_c3c3_2a3a_6d2d_350dc7a63291 -->|calls| df4238ce_ff67_ee56_17ce_54ac1d2fa297 195d465d_cb01_6c11_b964_d3f792d97f6f["path()"] 32dda52f_c3c3_2a3a_6d2d_350dc7a63291 -->|calls| 195d465d_cb01_6c11_b964_d3f792d97f6f style 32dda52f_c3c3_2a3a_6d2d_350dc7a63291 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
crates/ignore/src/dir.rs lines 408–533
fn matched_ignore<'a>(&'a self, path: &Path, is_dir: bool) -> Match<IgnoreMatch<'a>> {
let (mut m_custom_ignore, mut m_ignore, mut m_gi, mut m_gi_exclude, mut m_explicit) = (
Match::None,
Match::None,
Match::None,
Match::None,
Match::None,
);
let any_git = !self.0.opts.require_git || self.parents().any(|ig| ig.0.has_git);
let mut saw_git = false;
for ig in self.parents().take_while(|ig| !ig.0.is_absolute_parent) {
if m_custom_ignore.is_none() {
m_custom_ignore =
ig.0.custom_ignore_matcher
.matched(path, is_dir)
.map(IgnoreMatch::gitignore);
}
if m_ignore.is_none() {
m_ignore =
ig.0.ignore_matcher
.matched(path, is_dir)
.map(IgnoreMatch::gitignore);
}
if any_git && !saw_git && m_gi.is_none() {
m_gi =
ig.0.git_ignore_matcher
.matched(path, is_dir)
.map(IgnoreMatch::gitignore);
}
if any_git && !saw_git && m_gi_exclude.is_none() {
m_gi_exclude =
ig.0.git_exclude_matcher
.matched(path, is_dir)
.map(IgnoreMatch::gitignore);
}
saw_git = saw_git || ig.0.has_git;
}
if self.0.opts.parents {
if let Some(_) = self.absolute_base() {
// CHANGED: We removed a code path that rewrote the `path` to be relative to
// `self.absolute_base()` because it assumed that the every path is inside the base
// which is not the case for us as we use `WalkBuilder#add` to add roots outside of the
// base.
for ig in self.parents().skip_while(|ig| !ig.0.is_absolute_parent) {
if m_custom_ignore.is_none() {
m_custom_ignore =
ig.0.custom_ignore_matcher
.matched(&path, is_dir)
.map(IgnoreMatch::gitignore);
}
if m_ignore.is_none() {
m_ignore =
ig.0.ignore_matcher
.matched(&path, is_dir)
.map(IgnoreMatch::gitignore);
}
if any_git && !saw_git && m_gi.is_none() {
m_gi =
ig.0.git_ignore_matcher
.matched(&path, is_dir)
.map(IgnoreMatch::gitignore);
}
if any_git && !saw_git && m_gi_exclude.is_none() {
m_gi_exclude =
ig.0.git_exclude_matcher
.matched(&path, is_dir)
.map(IgnoreMatch::gitignore);
}
saw_git = saw_git || ig.0.has_git;
}
}
}
for gi in self.0.explicit_ignores.iter().rev() {
// CHANGED: We need to make sure that the explicit gitignore rules apply to the path
//
// path = Is the current file/folder we are traversing
// gi.path() = Is the path of the custom gitignore file
//
// E.g.: If we have a custom rule for `/src/utils` with `**/*`, and we are looking at
// just `/src`, then the `**/*` rules do not apply to this folder, so we can
// ignore the current custom gitignore file.
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does matched_ignore() do?
matched_ignore() is a function in the tailwindcss codebase, defined in crates/ignore/src/dir.rs.
Where is matched_ignore() defined?
matched_ignore() is defined in crates/ignore/src/dir.rs at line 408.
What does matched_ignore() call?
matched_ignore() calls 4 function(s): absolute_base, matched, parents, path.
What calls matched_ignore()?
matched_ignore() is called by 1 function(s): matched.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free