@@ -28,7 +28,9 @@ export enum CONFIG_KEYS {
2828 OCO_API_CUSTOM_HEADERS = 'OCO_API_CUSTOM_HEADERS' ,
2929 OCO_OMIT_SCOPE = 'OCO_OMIT_SCOPE' ,
3030 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'
3234}
3335
3436export enum CONFIG_MODES {
@@ -720,6 +722,24 @@ export const configValidators = {
720722 typeof value === 'boolean' ,
721723 'Must be true or false'
722724 ) ;
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 ;
723743 }
724744} ;
725745
@@ -757,6 +777,8 @@ export type ConfigType = {
757777 [ CONFIG_KEYS . OCO_OMIT_SCOPE ] : boolean ;
758778 [ CONFIG_KEYS . OCO_TEST_MOCK_TYPE ] : string ;
759779 [ CONFIG_KEYS . OCO_HOOK_AUTO_UNCOMMENT ] : boolean ;
780+ [ CONFIG_KEYS . OCO_SKIP_COMMIT_CONFIRM ] : boolean ;
781+ [ CONFIG_KEYS . OCO_SKIP_PUSH_PROMPT ] : boolean ;
760782} ;
761783
762784export const defaultConfigPath = pathJoin ( homedir ( ) , '.opencommit' ) ;
@@ -805,7 +827,9 @@ export const DEFAULT_CONFIG = {
805827 OCO_WHY : false ,
806828 OCO_OMIT_SCOPE : false ,
807829 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
809833} ;
810834
811835const initGlobalConfig = ( configPath : string = defaultConfigPath ) => {
@@ -846,7 +870,9 @@ const getEnvConfig = (envPath: string) => {
846870 OCO_TEST_MOCK_TYPE : process . env . OCO_TEST_MOCK_TYPE ,
847871 OCO_OMIT_SCOPE : parseConfigVarValue ( process . env . OCO_OMIT_SCOPE ) ,
848872
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 )
850876 } ;
851877} ;
852878
@@ -1062,6 +1088,16 @@ function getConfigKeyDetails(key) {
10621088 description : 'Automatically uncomment the commit message in the hook' ,
10631089 values : [ 'true' , 'false' ]
10641090 } ;
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+ } ;
10651101 default :
10661102 return {
10671103 description : 'String value' ,
0 commit comments