ScanConfig

Struct ScanConfig 

Source
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: bool

Whether to follow symbolic links (default: false).

§max_depth: Option<usize>

Maximum directory depth (None for unlimited).

§collect_metadata: bool

Whether to collect file metadata (default: false for faster scanning).

§parallel: bool

Whether to use parallel scanning (default: true for large projects).

§disable_default_excludes: bool

Whether 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: ErrorHandling

How to handle errors encountered during scanning. Default: CollectAndContinue (collect errors but don’t stop scanning).

§no_ignore: bool

Whether 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

Source

pub fn for_language(lang: &str) -> Self

Create a config for scanning a specific language.

Source

pub fn for_extensions(exts: &[&str]) -> Self

Create a config for scanning specific file extensions.

Source

pub fn with_includes(self, patterns: &[&str]) -> Self

Add include patterns.

Source

pub fn with_excludes(self, patterns: &[&str]) -> Self

Add exclude patterns.

Source

pub fn with_metadata(self) -> Self

Enable metadata collection.

Source

pub fn with_max_depth(self, depth: usize) -> Self

Set maximum traversal depth.

Source

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/**"]);
Source

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);
Source

pub fn fail_on_error(self) -> Self

Configure to fail fast on any error.

Shorthand for .with_error_handling(ErrorHandling::FailFast).

Source

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

Source§

fn clone(&self) -> ScanConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ScanConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ScanConfig

Source§

fn default() -> ScanConfig

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more