Skip to content

Commit 818fbb3

Browse files
committed
Temporarily disable v1 schema support within the IDE
1 parent 09c361e commit 818fbb3

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

crates/bins/src/bin/datadog_static_analyzer_server/ide/configuration_file/static_analysis_config_file.rs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,21 @@ impl TryFrom<String> for StaticAnalysisConfigFile {
4747
if content.trim().is_empty() {
4848
return Ok(Self::default());
4949
}
50-
let parsed = parse_any_schema_yaml(&content).map_err(|err| {
51-
match err {
52-
// Artificially represent this as a "parse" error for backwards compatibility.
53-
ConfigError::UnsupportedSchema(_) => ConfigFileError::Parser {
54-
source: serde_yaml::Error::custom(err),
55-
},
56-
ConfigError::Parse(err) => ConfigFileError::Parser { source: err },
57-
}
58-
})?;
50+
let parsed = if cfg!(test) {
51+
parse_any_schema_yaml(&content).map_err(|err| {
52+
match err {
53+
// Artificially represent this as a "parse" error for backwards compatibility.
54+
ConfigError::UnsupportedSchema(_) => ConfigFileError::Parser {
55+
source: serde_yaml::Error::custom(err),
56+
},
57+
ConfigError::Parse(err) => ConfigFileError::Parser { source: err },
58+
}
59+
})
60+
} else {
61+
file_legacy::parse_yaml(&content)
62+
.map(WithVersion::Legacy)
63+
.map_err(|err| ConfigFileError::Parser { source: err })
64+
}?;
5965
let config_file = match parsed {
6066
WithVersion::Legacy(yaml) => WithVersion::Legacy(file_legacy::ConfigFile::from(yaml)),
6167
WithVersion::CodeSecurity(yaml) => WithVersion::CodeSecurity(yaml),

0 commit comments

Comments
 (0)