@@ -7,7 +7,7 @@ use kernel::config::common::{
77 WithVersion ,
88} ;
99use kernel:: config:: file_legacy:: config_file_to_yaml;
10- use kernel:: config:: { file_legacy, file_v2 } ;
10+ use kernel:: config:: { file_legacy, file_v1 } ;
1111use kernel:: utils:: decode_base64_string;
1212use std:: { borrow:: Cow , fmt:: Debug } ;
1313use tracing:: instrument;
@@ -16,7 +16,7 @@ const WILDCARD_IGNORE: &str = "**";
1616
1717#[ derive( Debug , Clone , PartialEq ) ]
1818pub struct StaticAnalysisConfigFile {
19- config_file : WithVersion < file_legacy:: ConfigFile , file_v2 :: YamlConfigFile > ,
19+ config_file : WithVersion < file_legacy:: ConfigFile , file_v1 :: YamlConfigFile > ,
2020 original_content : Option < String > ,
2121}
2222
@@ -58,7 +58,7 @@ impl TryFrom<String> for StaticAnalysisConfigFile {
5858 } ) ?;
5959 let config_file = match parsed {
6060 WithVersion :: Legacy ( yaml) => WithVersion :: Legacy ( file_legacy:: ConfigFile :: from ( yaml) ) ,
61- WithVersion :: V2 ( yaml) => WithVersion :: V2 ( yaml) ,
61+ WithVersion :: CodeSecurity ( yaml) => WithVersion :: CodeSecurity ( yaml) ,
6262 } ;
6363 Ok ( Self {
6464 config_file,
@@ -172,7 +172,7 @@ impl StaticAnalysisConfigFile {
172172 ) ;
173173 }
174174 }
175- WithVersion :: V2 ( config) => {
175+ WithVersion :: CodeSecurity ( config) => {
176176 // (All logic for this is translated from the Legacy match arm)
177177 let map = config. ruleset_configs . get_or_insert_default ( ) ;
178178 let ruleset_config = map. 0 . entry ( ruleset_name. to_string ( ) ) . or_default ( ) ;
@@ -247,7 +247,7 @@ impl StaticAnalysisConfigFile {
247247 }
248248 }
249249 }
250- WithVersion :: V2 ( config) => {
250+ WithVersion :: CodeSecurity ( config) => {
251251 if rulesets. is_empty ( ) {
252252 return ;
253253 }
@@ -293,7 +293,7 @@ impl StaticAnalysisConfigFile {
293293 } ;
294294 match parsed. config_file {
295295 WithVersion :: Legacy ( config) => config. rulesets . iter ( ) . map ( |rs| rs. 0 . clone ( ) ) . collect ( ) ,
296- WithVersion :: V2 ( config) => config. use_rulesets . clone ( ) . unwrap_or_default ( ) ,
296+ WithVersion :: CodeSecurity ( config) => config. use_rulesets . clone ( ) . unwrap_or_default ( ) ,
297297 }
298298 }
299299
@@ -303,7 +303,7 @@ impl StaticAnalysisConfigFile {
303303 WithVersion :: Legacy ( config) => {
304304 config. paths . only . is_none ( ) && config. paths . ignore . is_empty ( )
305305 }
306- WithVersion :: V2 ( config) => {
306+ WithVersion :: CodeSecurity ( config) => {
307307 config. global_config . is_none ( )
308308 || config. global_config . as_ref ( ) . is_some_and ( |c| {
309309 c. path_config . ignore_paths . is_none ( ) && c. path_config . only_paths . is_none ( )
@@ -338,7 +338,7 @@ impl StaticAnalysisConfigFile {
338338 } )
339339 . join ( "\n " )
340340 }
341- WithVersion :: V2 ( config) => serde_yaml:: to_string ( & config) ?,
341+ WithVersion :: CodeSecurity ( config) => serde_yaml:: to_string ( & config) ?,
342342 } ;
343343 // reconcile and format
344344 // NOTE: if this fails, we're going to return the content
0 commit comments