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
ScanHitper reference (a variable referenced N times in one file produces N hits).
Required Methods§
Sourcefn scan(&self, root: &Path) -> Result<Vec<ScanHit>, ScannerError>
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.