pub struct ScanConfig {
pub language: Option<String>,
pub extensions: Vec<String>,
pub include_patterns: Vec<String>,
pub exclude_patterns: Vec<String>,
pub follow_symlinks: bool,
pub max_depth: Option<usize>,
pub collect_metadata: bool,
pub parallel: bool,
pub disable_default_excludes: bool,
pub error_handling: ErrorHandling,
pub no_ignore: bool,
}Expand description
Configuration for project scanning.
Fields§
§language: Option<String>Filter by specific language (e.g., “python”).
extensions: Vec<String>Filter by file extensions (e.g., [“.py”, “.pyi”]).
include_patterns: Vec<String>Glob patterns to include (e.g., [“src/**/*.rs”]).
exclude_patterns: Vec<String>Glob patterns to exclude (e.g., [“/test/”]).
follow_symlinks: boolWhether to follow symbolic links (default: false).
max_depth: Option<usize>Maximum directory depth (None for unlimited).
collect_metadata: boolWhether to collect file metadata (default: false for faster scanning).
parallel: boolWhether to use parallel scanning (default: true for large projects).
disable_default_excludes: boolWhether to disable default exclude patterns (node_modules, pycache, .git, etc.). Default: false (default excludes are applied). Set to true when you need to include files from typically-excluded directories like vendored dependencies in node_modules.
error_handling: ErrorHandlingHow to handle errors encountered during scanning. Default: CollectAndContinue (collect errors but don’t stop scanning).
no_ignore: boolWhether to ignore all ignore files (.gitignore, .brrrignore) and include all files. Default: false (respect ignore files). Set to true to bypass all ignore file processing (equivalent to –no-ignore flag).
Implementations§
Source§impl ScanConfig
impl ScanConfig
Sourcepub fn for_language(lang: &str) -> Self
pub fn for_language(lang: &str) -> Self
Create a config for scanning a specific language.
Sourcepub fn for_extensions(exts: &[&str]) -> Self
pub fn for_extensions(exts: &[&str]) -> Self
Create a config for scanning specific file extensions.
Sourcepub fn with_includes(self, patterns: &[&str]) -> Self
pub fn with_includes(self, patterns: &[&str]) -> Self
Add include patterns.
Sourcepub fn with_excludes(self, patterns: &[&str]) -> Self
pub fn with_excludes(self, patterns: &[&str]) -> Self
Add exclude patterns.
Sourcepub fn with_metadata(self) -> Self
pub fn with_metadata(self) -> Self
Enable metadata collection.
Sourcepub fn with_max_depth(self, depth: usize) -> Self
pub fn with_max_depth(self, depth: usize) -> Self
Set maximum traversal depth.
Sourcepub fn with_default_excludes_disabled(self) -> Self
pub fn with_default_excludes_disabled(self) -> Self
Disable default exclude patterns (node_modules, pycache, .git, etc.).
Use this when you need to include files from typically-excluded directories, such as vendored dependencies in node_modules or build artifacts you want to analyze.
§Example
use go_brrr::callgraph::scanner::ScanConfig;
// Include vendored dependencies from node_modules
let config = ScanConfig::default()
.with_default_excludes_disabled()
.with_includes(&["**/node_modules/vendor/**"]);Sourcepub fn with_error_handling(self, handling: ErrorHandling) -> Self
pub fn with_error_handling(self, handling: ErrorHandling) -> Self
Set how errors should be handled during scanning.
§Example
use go_brrr::callgraph::scanner::{ScanConfig, ErrorHandling};
// Fail immediately on any error
let strict_config = ScanConfig::default()
.with_error_handling(ErrorHandling::FailFast);
// Collect errors but continue scanning (default)
let permissive_config = ScanConfig::default()
.with_error_handling(ErrorHandling::CollectAndContinue);Sourcepub fn fail_on_error(self) -> Self
pub fn fail_on_error(self) -> Self
Configure to fail fast on any error.
Shorthand for .with_error_handling(ErrorHandling::FailFast).
Sourcepub fn with_no_ignore(self, no_ignore: bool) -> Self
pub fn with_no_ignore(self, no_ignore: bool) -> Self
Set whether to ignore all ignore files (.gitignore, .brrrignore).
When set to true, all files will be included regardless of ignore patterns.
This is equivalent to the --no-ignore CLI flag.
§Example
use go_brrr::callgraph::scanner::ScanConfig;
// Include all files, ignoring .gitignore and .brrrignore
let config = ScanConfig::default()
.with_no_ignore(true);Trait Implementations§
Source§impl Clone for ScanConfig
impl Clone for ScanConfig
Source§fn clone(&self) -> ScanConfig
fn clone(&self) -> ScanConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScanConfig
impl Debug for ScanConfig
Source§impl Default for ScanConfig
impl Default for ScanConfig
Source§fn default() -> ScanConfig
fn default() -> ScanConfig
Auto Trait Implementations§
impl Freeze for ScanConfig
impl RefUnwindSafe for ScanConfig
impl Send for ScanConfig
impl Sync for ScanConfig
impl Unpin for ScanConfig
impl UnwindSafe for ScanConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request