switch to ignore::walk for fmt/check
This commit is contained in:
1 parent
245ca9bce2
commit
ec80e6bd37
2 files changed
+1
-7
No files matched your search
@@ -8,7 +8,6 @@ use crate::BuildRequest;
|
|||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use futures_util::{stream::FuturesUnordered, StreamExt};
|
use futures_util::{stream::FuturesUnordered, StreamExt};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use walkdir::WalkDir;
|
|
||||||
|
|
||||||
/// Check the Rust files in the project for issues.
|
/// Check the Rust files in the project for issues.
|
||||||
#[derive(Clone, Debug, Parser)]
|
#[derive(Clone, Debug, Parser)]
|
||||||
@@ -125,8 +124,7 @@ async fn check_files_and_report(files_to_check: Vec<PathBuf>) -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn collect_rs_files(folder: &Path, files: &mut Vec<PathBuf>) {
|
pub(crate) fn collect_rs_files(folder: &Path, files: &mut Vec<PathBuf>) {
|
||||||
let dir = WalkDir::new(folder).follow_links(true).into_iter();
|
for entry in ignore::Walk::new(folder).flatten() {
|
||||||
for entry in dir.flatten() {
|
|
||||||
if entry.path().extension() == Some("rs".as_ref()) {
|
if entry.path().extension() == Some("rs".as_ref()) {
|
||||||
files.push(entry.path().to_path_buf());
|
files.push(entry.path().to_path_buf());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -348,10 +348,6 @@ impl Workspace {
|
|||||||
let mut ignore_builder = ignore::gitignore::GitignoreBuilder::new(workspace_dir);
|
let mut ignore_builder = ignore::gitignore::GitignoreBuilder::new(workspace_dir);
|
||||||
ignore_builder.add(workspace_dir.join(".gitignore"));
|
ignore_builder.add(workspace_dir.join(".gitignore"));
|
||||||
|
|
||||||
// todo!()
|
|
||||||
// let workspace_dir = self.workspace_dir();
|
|
||||||
// ignore_builder.add(workspace_dir.join(".gitignore"));
|
|
||||||
|
|
||||||
for path in Self::default_ignore_list() {
|
for path in Self::default_ignore_list() {
|
||||||
ignore_builder
|
ignore_builder
|
||||||
.add_line(None, path)
|
.add_line(None, path)
|
||||||
|
|||||||
Reference in new issue
Block a user