based on Polyglot Code Scanner with changes:
- keep git logic only.
- publish to crates.io
todo:
- add git clone.
- add history.
- merge cmd from coco.
examples:
use git_scanner::flare::FlareTreeNode;use git_scanner::git::GitCalculator;use git_scanner::git_logger::GitLogConfig;use git_scanner::{file_walker,IndicatorCalculator};use std::path::PathBuf;pubfnby_path(root:PathBuf) -> FlareTreeNode{letmut tics:Vec<Box<dynIndicatorCalculator>> = vec![];let calculator = Box::new(GitCalculator::new(GitLogConfig::default().include_merges(true).since_years(3),true,));
tics.push(calculator);letmut tree = file_walker::walk_directory(&root,&mut tics).unwrap();for tic in tics {ifletSome(metadata) = tic.metadata().unwrap(){
tree.add_data(tic.name() + "_meta", metadata);}}return tree;}Copyright 2019 Kornelis Sietsma
Copyright © 2021 Inherd Group
Licensed under the Apache License, Version 2.0 - see LICENSE.txt for details