Crates.io | project_parse |
lib.rs | project_parse |
version | 0.1.4 |
source | src |
created_at | 2022-03-29 20:16:24.964276 |
updated_at | 2022-04-02 06:56:32.282676 |
description | Parse code project directories, detect main language, count lines of code and more. |
homepage | |
repository | https://github.com/mugendi/project_parse |
max_upload_size | |
id | 558791 |
size | 44,124 |
This module parses a coding project directory and does a few nifty things such as:
let dir = "/my/project/dir";
// Init new project::Project
let mut project = project::Project::new(dir)?;
// Parse project
project.parse()?;
// Add some files to ignore
let ignore_str = "files/to/ignore/1.js \n files/to/ignore/2.rs ";
// Pass false for update_existing to update generic
project.set_gitignore(ignore_str, &false)?;
// If you would like to also add the user defined
project.use_project_gitignore(&true)?;
// Check if a specific file is ignored
println!("1 {:?}", project.is_ignored("files/to/ignore/1.js"));
// Get project code stats.
project.get_code_stats()?;
println!("{:#?}", project);