Skip to main content

CodeScanner

Trait CodeScanner 

Source
pub trait CodeScanner: Send + Sync {
    // Required method
    fn scan(&self, root: &Path) -> Result<Vec<ScanHit>, ScannerError>;
}
Expand description

Walk a directory tree looking for references to environment variables.

Implementations should:

  • skip common build/output directories (target, node_modules, dist, …);
  • skip binary files (no UTF-8) without error;
  • return one ScanHit per reference (a variable referenced N times in one file produces N hits).

Required Methods§

Source

fn scan(&self, root: &Path) -> Result<Vec<ScanHit>, ScannerError>

Scan the directory rooted at root and return all hits.

§Errors

Returns ScannerError::Io if the file system cannot be walked; ScannerError::Pattern if the configured patterns are invalid.

Implementors§