Skip to content

Commit b8b0fcf

Browse files
committed
cli/core: drop --fail-on-find and allow/deny filters; docs updated
1 parent d6a0db3 commit b8b0fcf

File tree

3 files changed

+0
-35
lines changed

3 files changed

+0
-35
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ Key flags:
2626
- `--patterns PATH`: specify patterns file (default: `patterns.toml`)
2727
- `--progress`: show progress bar during scanning
2828
- `--include-glob GLOB` / `--exclude-glob GLOB`
29-
- `--allow LIB` / `--deny LIB`
3029
- `--deterministic`: stable output ordering
31-
- `--fail-on-find`: exit 2 if findings exist
3230
- `--print-config`: print loaded `patterns.toml`
3331
- `--dry-run`: list files to be scanned
3432

crates/cli/src/main.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,10 @@ struct Args {
3939
#[arg(long, value_name = "GLOB")]
4040
exclude_glob: Vec<String>,
4141

42-
/// Allow only these libraries
43-
#[arg(long, value_name = "LIB")]
44-
allow: Vec<String>,
45-
46-
/// Deny these libraries
47-
#[arg(long, value_name = "LIB")]
48-
deny: Vec<String>,
49-
5042
/// Deterministic output ordering
5143
#[arg(long, action = ArgAction::SetTrue)]
5244
deterministic: bool,
5345

54-
/// Fail with code 2 if findings are present
55-
#[arg(long, action = ArgAction::SetTrue)]
56-
fail_on_find: bool,
57-
5846
/// Print merged patterns/config and exit
5947
#[arg(long, action = ArgAction::SetTrue)]
6048
print_config: bool,
@@ -154,8 +142,6 @@ fn main() -> Result<()> {
154142
let mut cfg = Config {
155143
include_globs: args.include_glob.clone(),
156144
exclude_globs: args.exclude_glob.clone(),
157-
allow_libs: args.allow.clone(),
158-
deny_libs: args.deny.clone(),
159145
deterministic: args.deterministic,
160146
..Default::default()
161147
};
@@ -210,9 +196,6 @@ fn main() -> Result<()> {
210196
fs::write(sarif_path, serde_json::to_vec_pretty(&sarif)?)?;
211197
}
212198

213-
if args.fail_on_find && !findings.is_empty() {
214-
std::process::exit(2);
215-
}
216199
Ok(())
217200
}
218201

crates/scanner-core/src/lib.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,6 @@ pub struct Config {
180180
#[serde(default)]
181181
pub exclude_globs: Vec<String>,
182182
#[serde(default)]
183-
pub allow_libs: Vec<String>,
184-
#[serde(default)]
185-
pub deny_libs: Vec<String>,
186-
#[serde(default)]
187183
pub deterministic: bool,
188184
#[serde(skip)]
189185
pub progress_callback: Option<ProgressCallback>,
@@ -199,8 +195,6 @@ impl std::fmt::Debug for Config {
199195
.field("max_file_size", &self.max_file_size)
200196
.field("include_globs", &self.include_globs)
201197
.field("exclude_globs", &self.exclude_globs)
202-
.field("allow_libs", &self.allow_libs)
203-
.field("deny_libs", &self.deny_libs)
204198
.field("deterministic", &self.deterministic)
205199
.field("progress_callback", &"<callback>")
206200
.finish()
@@ -213,8 +207,6 @@ impl Clone for Config {
213207
max_file_size: self.max_file_size,
214208
include_globs: self.include_globs.clone(),
215209
exclude_globs: self.exclude_globs.clone(),
216-
allow_libs: self.allow_libs.clone(),
217-
deny_libs: self.deny_libs.clone(),
218210
deterministic: self.deterministic,
219211
progress_callback: self.progress_callback.clone(),
220212
}
@@ -227,8 +219,6 @@ impl Default for Config {
227219
max_file_size: default_max_file_size(),
228220
include_globs: default_include_globs(),
229221
exclude_globs: Vec::new(),
230-
allow_libs: Vec::new(),
231-
deny_libs: Vec::new(),
232222
deterministic: false,
233223
progress_callback: None,
234224
}
@@ -920,12 +910,6 @@ impl<'a> Scanner<'a> {
920910
});
921911
}
922912

923-
findings.retain(|f| {
924-
self.config.allow_libs.is_empty()
925-
|| self.config.allow_libs.iter().any(|a| a == &f.library)
926-
});
927-
findings.retain(|f| !self.config.deny_libs.iter().any(|d| d == &f.library));
928-
929913
Ok(findings)
930914
}
931915
}

0 commit comments

Comments
 (0)