feat: Add arguments to pipupgrade and fix enable_pipupgrade check (#448)

This commit is contained in:
slowsage
2023-05-30 03:04:23 -04:00
committed by GitHub
parent f6e8af186c
commit d4548b2f9a
3 changed files with 17 additions and 6 deletions

View File

@@ -243,6 +243,7 @@ pub struct Python {
enable_pip_review: Option<bool>,
enable_pip_review_local: Option<bool>,
enable_pipupgrade: Option<bool>,
pipupgrade_arguments: Option<String>,
}
#[derive(Deserialize, Default, Debug, Merge)]
@@ -1462,6 +1463,13 @@ impl Config {
.and_then(|python| python.enable_pipupgrade)
.unwrap_or(false);
}
pub fn pipupgrade_arguments(&self) -> &str {
self.config_file
.python
.as_ref()
.and_then(|s| s.pipupgrade_arguments.as_deref())
.unwrap_or("")
}
pub fn enable_pip_review(&self) -> bool {
return self
.config_file