@@ -28,7 +28,9 @@ export enum CONFIG_KEYS {
28
28
OCO_API_CUSTOM_HEADERS = 'OCO_API_CUSTOM_HEADERS' ,
29
29
OCO_OMIT_SCOPE = 'OCO_OMIT_SCOPE' ,
30
30
OCO_GITPUSH = 'OCO_GITPUSH' , // todo: deprecate
31
- OCO_HOOK_AUTO_UNCOMMENT = 'OCO_HOOK_AUTO_UNCOMMENT'
31
+ OCO_HOOK_AUTO_UNCOMMENT = 'OCO_HOOK_AUTO_UNCOMMENT' ,
32
+ OCO_SKIP_COMMIT_CONFIRM = 'OCO_SKIP_COMMIT_CONFIRM' ,
33
+ OCO_SKIP_PUSH_PROMPT = 'OCO_SKIP_PUSH_PROMPT'
32
34
}
33
35
34
36
export enum CONFIG_MODES {
@@ -720,6 +722,24 @@ export const configValidators = {
720
722
typeof value === 'boolean' ,
721
723
'Must be true or false'
722
724
) ;
725
+ } ,
726
+
727
+ [ CONFIG_KEYS . OCO_SKIP_COMMIT_CONFIRM ] ( value : any ) {
728
+ validateConfig (
729
+ CONFIG_KEYS . OCO_SKIP_COMMIT_CONFIRM ,
730
+ typeof value === 'boolean' ,
731
+ 'Must be true or false'
732
+ ) ;
733
+ return value ;
734
+ } ,
735
+
736
+ [ CONFIG_KEYS . OCO_SKIP_PUSH_PROMPT ] ( value : any ) {
737
+ validateConfig (
738
+ CONFIG_KEYS . OCO_SKIP_PUSH_PROMPT ,
739
+ typeof value === 'boolean' ,
740
+ 'Must be true or false'
741
+ ) ;
742
+ return value ;
723
743
}
724
744
} ;
725
745
@@ -757,6 +777,8 @@ export type ConfigType = {
757
777
[ CONFIG_KEYS . OCO_OMIT_SCOPE ] : boolean ;
758
778
[ CONFIG_KEYS . OCO_TEST_MOCK_TYPE ] : string ;
759
779
[ CONFIG_KEYS . OCO_HOOK_AUTO_UNCOMMENT ] : boolean ;
780
+ [ CONFIG_KEYS . OCO_SKIP_COMMIT_CONFIRM ] : boolean ;
781
+ [ CONFIG_KEYS . OCO_SKIP_PUSH_PROMPT ] : boolean ;
760
782
} ;
761
783
762
784
export const defaultConfigPath = pathJoin ( homedir ( ) , '.opencommit' ) ;
@@ -805,7 +827,9 @@ export const DEFAULT_CONFIG = {
805
827
OCO_WHY : false ,
806
828
OCO_OMIT_SCOPE : false ,
807
829
OCO_GITPUSH : true , // todo: deprecate
808
- OCO_HOOK_AUTO_UNCOMMENT : false
830
+ OCO_HOOK_AUTO_UNCOMMENT : false ,
831
+ OCO_SKIP_COMMIT_CONFIRM : false ,
832
+ OCO_SKIP_PUSH_PROMPT : false
809
833
} ;
810
834
811
835
const initGlobalConfig = ( configPath : string = defaultConfigPath ) => {
@@ -846,7 +870,9 @@ const getEnvConfig = (envPath: string) => {
846
870
OCO_TEST_MOCK_TYPE : process . env . OCO_TEST_MOCK_TYPE ,
847
871
OCO_OMIT_SCOPE : parseConfigVarValue ( process . env . OCO_OMIT_SCOPE ) ,
848
872
849
- OCO_GITPUSH : parseConfigVarValue ( process . env . OCO_GITPUSH ) // todo: deprecate
873
+ OCO_GITPUSH : parseConfigVarValue ( process . env . OCO_GITPUSH ) , // todo: deprecate
874
+ OCO_SKIP_COMMIT_CONFIRM : parseConfigVarValue ( process . env . OCO_SKIP_COMMIT_CONFIRM ) ,
875
+ OCO_SKIP_PUSH_PROMPT : parseConfigVarValue ( process . env . OCO_SKIP_PUSH_PROMPT )
850
876
} ;
851
877
} ;
852
878
@@ -1062,6 +1088,16 @@ function getConfigKeyDetails(key) {
1062
1088
description : 'Automatically uncomment the commit message in the hook' ,
1063
1089
values : [ 'true' , 'false' ]
1064
1090
} ;
1091
+ case CONFIG_KEYS . OCO_SKIP_COMMIT_CONFIRM :
1092
+ return {
1093
+ description : 'Skip the commit message confirmation prompt and auto-commit with generated message' ,
1094
+ values : [ 'true' , 'false' ]
1095
+ } ;
1096
+ case CONFIG_KEYS . OCO_SKIP_PUSH_PROMPT :
1097
+ return {
1098
+ description : 'Skip the git push prompt and never ask to push after committing' ,
1099
+ values : [ 'true' , 'false' ]
1100
+ } ;
1065
1101
default :
1066
1102
return {
1067
1103
description : 'String value' ,
0 commit comments