gitignore.rs — tailwindcss Source File
Architecture documentation for gitignore.rs, a rust file in the tailwindcss codebase. 6 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 61377720_4557_3c63_7653_b6ed73e2face["gitignore.rs"] 30bf0f52_0780_5ef3_aec5_213150847fc1["super::"] 61377720_4557_3c63_7653_b6ed73e2face --> 30bf0f52_0780_5ef3_aec5_213150847fc1 cf006a3e_51d2_5361_1dd4_6d904d0bfa75["std::"] 61377720_4557_3c63_7653_b6ed73e2face --> cf006a3e_51d2_5361_1dd4_6d904d0bfa75 81ece9c1_054c_504a_d7a0_4d0590ba157c["crate::"] 61377720_4557_3c63_7653_b6ed73e2face --> 81ece9c1_054c_504a_d7a0_4d0590ba157c 56bb0958_daba_e14c_a02e_b3eea08ae641["std::sync::OnceLock"] 61377720_4557_3c63_7653_b6ed73e2face --> 56bb0958_daba_e14c_a02e_b3eea08ae641 85d31a27_1cce_650a_b9da_6de3bcab4873["regex_automata::"] 61377720_4557_3c63_7653_b6ed73e2face --> 85d31a27_1cce_650a_b9da_6de3bcab4873 a6aeab6e_a19a_3d64_9b92_03c5c0f78918["std::path::Path"] 61377720_4557_3c63_7653_b6ed73e2face --> a6aeab6e_a19a_3d64_9b92_03c5c0f78918 style 61377720_4557_3c63_7653_b6ed73e2face fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
/*!
The gitignore module provides a way to match globs from a gitignore file
against file paths.
Note that this module implements the specification as described in the
`gitignore` man page from scratch. That is, this module does *not* shell out to
the `git` command line tool.
*/
use std::{
fs::File,
io::{BufRead, BufReader, Read},
path::{Path, PathBuf},
sync::Arc,
};
use {
globset::{Candidate, GlobBuilder, GlobSet, GlobSetBuilder},
regex_automata::util::pool::Pool,
};
use crate::{
Error, Match, PartialErrorBuilder,
pathutil::{is_file_name, strip_prefix},
};
/// Glob represents a single glob in a gitignore file.
///
/// This is used to report information about the highest precedent glob that
/// matched in one or more gitignore files.
#[derive(Clone, Debug)]
pub struct Glob {
/// The file path that this glob was extracted from.
from: Option<PathBuf>,
/// The original glob string.
original: String,
/// The actual glob string used to convert to a regex.
actual: String,
/// Whether this is a whitelisted glob or not.
is_whitelist: bool,
/// Whether this glob should only match directories or not.
is_only_dir: bool,
}
impl Glob {
/// Returns the file path that defined this glob.
pub fn from(&self) -> Option<&Path> {
self.from.as_ref().map(|p| &**p)
}
/// The original glob as it was defined in a gitignore file.
pub fn original(&self) -> &str {
&self.original
}
/// The actual glob that was compiled to respect gitignore
/// semantics.
pub fn actual(&self) -> &str {
&self.actual
}
// ... (809 more lines)
Domain
Subdomains
Functions
- actual()
- add()
- add_line()
- add_str()
- allow_unclosed_class()
- build()
- build_global()
- bytes()
- case_insensitive()
- empty()
- excludes_file_default()
- expand_tilde()
- from()
- gi_from_str()
- gitconfig_excludes_path()
- gitconfig_home_contents()
- gitconfig_xdg_contents()
- global()
- has_doublestar_prefix()
- home_dir()
- is_empty()
- is_only_dir()
- is_whitelist()
- len()
- matched()
- matched_path_or_any_parents()
- matched_stripped()
- new()
- num_ignores()
- num_whitelists()
- only_on_files()
- original()
- parse_excludes_file()
- parse_excludes_file1()
- parse_excludes_file2()
- parse_excludes_file3()
- parse_excludes_file4()
- parse_excludes_file5()
- path()
- path_string()
- regression_106()
- strip()
Dependencies
- crate::
- regex_automata::
- std::
- std::path::Path
- std::sync::OnceLock
- super::
Source
Frequently Asked Questions
What does gitignore.rs do?
gitignore.rs is a source file in the tailwindcss codebase, written in rust. It belongs to the Oxide domain, Extractor subdomain.
What functions are defined in gitignore.rs?
gitignore.rs defines 42 function(s): actual, add, add_line, add_str, allow_unclosed_class, build, build_global, bytes, case_insensitive, empty, and 32 more.
What does gitignore.rs depend on?
gitignore.rs imports 6 module(s): crate::, regex_automata::, std::, std::path::Path, std::sync::OnceLock, super::.
Where is gitignore.rs in the architecture?
gitignore.rs is located at crates/ignore/src/gitignore.rs (domain: Oxide, subdomain: Extractor, directory: crates/ignore/src).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free