tokmd-scan
Source code scanning adapter for tokmd.
Overview
This is a Tier 1 crate that wraps the tokei library, isolating this dependency to a single location. It handles configuration mapping and scan execution.
Installation
[]
= "1.3"
Usage
use scan;
use GlobalArgs;
use PathBuf;
let args = default;
let paths = vec!;
let languages = scan?;
// Returns tokei::Languages with code statistics
Configuration Mapping
Maps GlobalArgs fields to tokei configuration:
| Arg | Effect |
|---|---|
hidden |
Include hidden files/directories |
no_ignore |
Skip all ignore files |
no_ignore_dot |
Skip .ignore files |
no_ignore_parent |
Skip parent ignore files |
no_ignore_vcs |
Skip .gitignore |
treat_doc_strings_as_comments |
Count doc strings as comments |
config |
Config file loading strategy |
Error Handling
- Returns error for non-existent paths (as of v1.3.0)
- Propagates tokei configuration errors
- Empty
Languagesfor valid but empty directories
Dependencies
tokei- Core line countingtokmd-config- GlobalArgs definitiontokmd-types- ConfigMode enum
License
MIT OR Apache-2.0