Skip to content

Commit

Permalink
Support max_depth config without breaking stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Sep 26, 2024
1 parent bd96959 commit 9030463
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/analyzer/config/json_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use rustc_hash::FxHashMap;
use serde::Deserialize;

#[derive(Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct JsonConfig {
#[serde(default)]
pub ignore_files: Vec<String>,
Expand All @@ -24,7 +23,7 @@ pub struct JsonConfig {
pub struct JsonSecurityConfig {
pub ignore_files: Vec<String>,
pub ignore_sink_files: FxHashMap<String, Vec<String>>,
pub max_depth: u8,
pub max_depth: Option<u8>,
}

pub(crate) fn read_from_file(path: &Path) -> Result<JsonConfig, Box<dyn Error>> {
Expand Down
2 changes: 1 addition & 1 deletion src/analyzer/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl Config {
)
})
.collect();
self.security_config.max_depth = json_config.security_analysis.max_depth;
self.security_config.max_depth = json_config.security_analysis.max_depth.unwrap_or(40);

Ok(())
}
Expand Down

0 comments on commit 9030463

Please sign in to comment.