-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(foundry-ignore-compile): read from ignore file and filter out al… #1
base: feature/foundry-ignore-compile
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please apply current rustfmt.toml
crates/config/src/lib.rs
Outdated
let foundry_ignored_paths: Vec<String> = self.get_ignore_paths()?; | ||
|
||
if foundry_ignored_paths.is_empty() { | ||
println!("No ignored paths found"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer use warning
here
crates/config/src/lib.rs
Outdated
let foundry_ignored_paths: Vec<String> = self.get_ignore_paths()?; | ||
|
||
if foundry_ignored_paths.is_empty() { | ||
println!("No ignored paths found"); | ||
} | ||
|
||
let ignore_pattern: Vec<GlobMatcher> = foundry_ignored_paths | ||
.iter() | ||
.filter_map(|path| GlobMatcher::from_str(path).ok()) | ||
.collect(); | ||
|
||
let ignore_filter: SkipBuildFilters = | ||
SkipBuildFilters::new(ignore_pattern.clone(), self.root.0.clone()); | ||
builder = builder.sparse_output(ignore_filter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Group these lines in to a fn
crates/config/src/lib.rs
Outdated
let foundry_ignored_paths: Vec<String> = self.get_ignore_paths()?; | ||
|
||
if foundry_ignored_paths.is_empty() { | ||
println!("No ignored paths found"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
println!("No ignored paths found"); | |
println!("No skipped paths found in .foundryignore"); |
|
||
let ignore_filter: SkipBuildFilters = | ||
SkipBuildFilters::new(ignore_pattern.clone(), self.root.0.clone()); | ||
builder = builder.sparse_output(ignore_filter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
builder = builder.sparse_output(ignore_filter); | |
builder = builder.sparse_output(ignore_filter); |
crates/config/src/lib.rs
Outdated
if !path.exists() { | ||
return Ok(Vec::new()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return more clear error, to differentiate "file not found", and "file not contains items"
Description
This PR adds a feature to allow ignoring all paths specified in the foundry_ignore file when running forge build.