Skip to content

Commit bd0e4a7

Browse files
authored
fix(forge): do not warn on backward compatible solc_version config (#11916)
fix(forge): do not warn on backward compatible solc_version key
1 parent 3c15aee commit bd0e4a7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

crates/config/src/providers/warnings.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,13 @@ impl<P: Provider> WarningsProvider<P> {
110110
let is_not_allowed = !allowed_keys.contains(key)
111111
&& !allowed_keys.contains(&key.to_snake_case());
112112
let is_not_reserved = key != "extends" && key != Self::WARNINGS_KEY;
113+
let is_not_backward_compatible = key != "solc_version";
113114

114-
if is_not_deprecated && is_not_allowed && is_not_reserved {
115+
if is_not_deprecated
116+
&& is_not_allowed
117+
&& is_not_reserved
118+
&& is_not_backward_compatible
119+
{
115120
out.push(Warning::UnknownKey {
116121
key: key.clone(),
117122
profile: profile.clone(),

crates/forge/tests/cli/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,6 +1953,7 @@ forgetest!(config_warnings_on_unknown_keys, |prj, cmd| {
19531953
let faulty_toml = r"[profile.default]
19541954
src = 'src'
19551955
out = 'out'
1956+
solc_version = '0.8.18'
19561957
foo = 'unknown'
19571958
19581959
[profile.another]

0 commit comments

Comments
 (0)