mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-15 22:01:05 +00:00
solidity: update custom warnings and version validation (#193)
This commit is contained in:
@@ -36,4 +36,26 @@ impl Version {
|
||||
l2_revision: None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn validate(self, include_paths: &[String]) -> anyhow::Result<Self> {
|
||||
if self.default < super::FIRST_SUPPORTED_VERSION {
|
||||
anyhow::bail!(
|
||||
"`solc` versions <{} are not supported, found {}",
|
||||
super::FIRST_SUPPORTED_VERSION,
|
||||
self.default
|
||||
);
|
||||
}
|
||||
if self.default > super::LAST_SUPPORTED_VERSION {
|
||||
anyhow::bail!(
|
||||
"`solc` versions >{} are not supported, found {}",
|
||||
super::LAST_SUPPORTED_VERSION,
|
||||
self.default
|
||||
);
|
||||
}
|
||||
if !include_paths.is_empty() && self.default < super::FIRST_INCLUDE_PATH_VERSION {
|
||||
anyhow::bail!("--include-path is not supported in solc {}", self.default);
|
||||
}
|
||||
|
||||
Ok(self)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user