@@ -5,7 +5,9 @@ use anyhow::{bail, Result};
55use colored:: * ;
66use serde:: { Deserialize , Serialize } ;
77
8- use crate :: project_info:: { is_valid_python_version, LicenseType , ProjectManager } ;
8+ use crate :: project_info:: {
9+ is_valid_python_version, Day , DependabotSchedule , LicenseType , ProjectManager ,
10+ } ;
911
1012#[ derive( Debug , Deserialize , Serialize ) ]
1113pub struct Config {
@@ -19,6 +21,8 @@ pub struct Config {
1921 pub github_actions_python_test_versions : Option < Vec < String > > ,
2022 pub max_line_length : Option < u8 > ,
2123 pub use_dependabot : Option < bool > ,
24+ pub dependabot_schedule : Option < DependabotSchedule > ,
25+ pub dependabot_day : Option < Day > ,
2226 pub use_continuous_deployment : Option < bool > ,
2327 pub use_release_drafter : Option < bool > ,
2428 pub use_multi_os_ci : Option < bool > ,
@@ -38,6 +42,8 @@ impl Config {
3842 github_actions_python_test_versions : None ,
3943 max_line_length : None ,
4044 use_dependabot : None ,
45+ dependabot_schedule : None ,
46+ dependabot_day : None ,
4147 use_continuous_deployment : None ,
4248 use_release_drafter : None ,
4349 use_multi_os_ci : None ,
@@ -233,6 +239,32 @@ impl Config {
233239 Ok ( ( ) )
234240 }
235241
242+ pub fn save_dependabot_schedule ( value : DependabotSchedule ) -> Result < ( ) > {
243+ if let Ok ( mut config) = Config :: load_config ( ) {
244+ config. dependabot_schedule = Some ( value) ;
245+ if config. save ( ) . is_err ( ) {
246+ raise_error ( ) ?;
247+ } ;
248+ } else {
249+ raise_error ( ) ?;
250+ }
251+
252+ Ok ( ( ) )
253+ }
254+
255+ pub fn save_dependabot_day ( value : Day ) -> Result < ( ) > {
256+ if let Ok ( mut config) = Config :: load_config ( ) {
257+ config. dependabot_day = Some ( value) ;
258+ if config. save ( ) . is_err ( ) {
259+ raise_error ( ) ?;
260+ } ;
261+ } else {
262+ raise_error ( ) ?;
263+ }
264+
265+ Ok ( ( ) )
266+ }
267+
236268 pub fn save_use_continuous_deployment ( value : bool ) -> Result < ( ) > {
237269 if let Ok ( mut config) = Config :: load_config ( ) {
238270 config. use_continuous_deployment = Some ( value) ;
@@ -345,6 +377,13 @@ impl Config {
345377 println ! ( "{}: null" , gha_python_label. blue( ) ) ;
346378 }
347379
380+ let project_manager_label = "Project Manager" ;
381+ if let Some ( project_manager) = config. project_manager {
382+ println ! ( "{}: {:?}" , project_manager_label. blue( ) , project_manager) ;
383+ } else {
384+ println ! ( "{}: null" , project_manager_label. blue( ) ) ;
385+ }
386+
348387 let max_line_length_label = "Max Line Length" ;
349388 if let Some ( max_line_length) = config. max_line_length {
350389 println ! ( "{}: {max_line_length}" , max_line_length_label. blue( ) ) ;
@@ -359,6 +398,24 @@ impl Config {
359398 println ! ( "{}: null" , use_dependabot_label. blue( ) ) ;
360399 }
361400
401+ let dependabot_schedule_label = "Dependabot Schedule" ;
402+ if let Some ( dependabot_schedule) = config. dependabot_schedule {
403+ println ! (
404+ "{}: {:?}" ,
405+ dependabot_schedule_label. blue( ) ,
406+ dependabot_schedule
407+ ) ;
408+ } else {
409+ println ! ( "{}: null" , dependabot_schedule_label. blue( ) ) ;
410+ }
411+
412+ let dependabot_day_label = "Dependabot Day" ;
413+ if let Some ( dependabot_day) = config. dependabot_day {
414+ println ! ( "{}: {:?}" , dependabot_day_label. blue( ) , dependabot_day) ;
415+ } else {
416+ println ! ( "{}: null" , dependabot_day_label. blue( ) ) ;
417+ }
418+
362419 let use_continuous_deployment_label = "Use Continuous Deployment" ;
363420 if let Some ( use_continuous_deployment) = config. use_continuous_deployment {
364421 println ! (
0 commit comments