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 fb038a5b_bec2_4158_52f9_87530af3ef38["matched_ignore()"] a558c8e1_3e7c_59d2_b113_bacec65ba188["dir.rs"] fb038a5b_bec2_4158_52f9_87530af3ef38 -->|defined in| a558c8e1_3e7c_59d2_b113_bacec65ba188 610d87f4_d454_8c17_656c_4616db7298c0["matched()"] 610d87f4_d454_8c17_656c_4616db7298c0 -->|calls| fb038a5b_bec2_4158_52f9_87530af3ef38 661b1a9f_f6e6_5cda_0f58_724ddbadaed4["parents()"] fb038a5b_bec2_4158_52f9_87530af3ef38 -->|calls| 661b1a9f_f6e6_5cda_0f58_724ddbadaed4 a008c0b2_197b_fbf4_977d_e4ae3b4d80c4["absolute_base()"] fb038a5b_bec2_4158_52f9_87530af3ef38 -->|calls| a008c0b2_197b_fbf4_977d_e4ae3b4d80c4 610d87f4_d454_8c17_656c_4616db7298c0["matched()"] fb038a5b_bec2_4158_52f9_87530af3ef38 -->|calls| 610d87f4_d454_8c17_656c_4616db7298c0 1b1bc826_12bc_290a_5930_aa622cf5e9e9["path()"] fb038a5b_bec2_4158_52f9_87530af3ef38 -->|calls| 1b1bc826_12bc_290a_5930_aa622cf5e9e9 style fb038a5b_bec2_4158_52f9_87530af3ef38 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