Hey, I like your project and tried to use it today.
After building the source, I run it in my project just to find out that there are a few problems in the source code that I want to address.
First, you require the user to have a .gitignore file in his project. If the user does not have it, the program will fail at
let gitignore = fs::read_to_string(".gitignore")?;
To solve this error, I personally changed it to this:
let gitignore = fs::read_to_string(".gitignore");
let gitignore = if gitignore.is_ok() {
gitignore
.unwrap()
.lines()
.map(|line| line.trim())
.filter(|line| !line.starts_with('#'))
.map(|line| line.to_string())
.collect::<Vec<String>>()
} else {
vec![]
};
That works fine for me because now, having a gitignore is optional.
Second, you require the user to add extensions to all files. Files with no extensions will let the program fail aswell here:
if !supported_filetypes.contains(&entry.path().extension().unwrap().to_str().unwrap()) {
// ^^ here will it fail
continue;
}
I solved that issue by using a let Some:
if let Some(extension) = &entry.path().extension() {
if !supported_filetypes.contains(&extension.to_str().unwrap()) {
continue;
}
}
That were two things I wanted to address.
Nontheless, it is a great project and I hope somebody will find this usefull
~ Marius, 2023
maybe someone wants to create a pull request for that...?
Hey, I like your project and tried to use it today.
After building the source, I run it in my project just to find out that there are a few problems in the source code that I want to address.
First, you require the user to have a
.gitignorefile in his project. If the user does not have it, the program will fail atTo solve this error, I personally changed it to this:
That works fine for me because now, having a gitignore is optional.
Second, you require the user to add extensions to all files. Files with no extensions will let the program fail aswell here:
I solved that issue by using a
let Some:That were two things I wanted to address.
Nontheless, it is a great project and I hope somebody will find this usefull
~ Marius, 2023