Skip to content

Commit dc4a332

Browse files
authored
Merge branch 'master' into feat/pre-commit
2 parents 3e24502 + 7feb3ec commit dc4a332

27 files changed

+419
-115
lines changed

out/cli.cjs

Lines changed: 146 additions & 35 deletions
Large diffs are not rendered by default.

out/github-action.cjs

Lines changed: 144 additions & 34 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencommit",
3-
"version": "3.2.5",
3+
"version": "3.2.7",
44
"description": "Auto-generate impressive commits in 1 second. Killing lame commits with AI 🤯🔫",
55
"keywords": [
66
"git",

src/commands/config.ts

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ export enum CONFIG_KEYS {
2525
OCO_ONE_LINE_COMMIT = 'OCO_ONE_LINE_COMMIT',
2626
OCO_TEST_MOCK_TYPE = 'OCO_TEST_MOCK_TYPE',
2727
OCO_API_URL = 'OCO_API_URL',
28-
OCO_GITPUSH = 'OCO_GITPUSH',
2928
OCO_ENABLE_LOGGING = 'OCO_ENABLE_LOGGING',
3029
OCO_ENABLE_CACHE = 'OCO_ENABLE_CACHE',
3130
OCO_CACHE_DIR = 'OCO_CACHE_DIR',
3231
OCO_LOG_DIR = 'OCO_LOG_DIR'
32+
OCO_OMIT_SCOPE = 'OCO_OMIT_SCOPE',
33+
OCO_GITPUSH = 'OCO_GITPUSH' // todo: deprecate
3334
}
3435

3536
export enum CONFIG_MODES {
@@ -131,12 +132,9 @@ export const MODEL_LIST = {
131132
'pixtral-12b-latest',
132133
'mistral-embed',
133134
'mistral-moderation-2411',
134-
'mistral-moderation-latest',
135+
'mistral-moderation-latest'
135136
],
136-
deepseek : [
137-
'deepseek-chat',
138-
'deepseek-reasoner',
139-
]
137+
deepseek: ['deepseek-chat', 'deepseek-reasoner']
140138
};
141139

142140
const getDefaultModel = (provider: string | undefined): string => {
@@ -154,7 +152,7 @@ const getDefaultModel = (provider: string | undefined): string => {
154152
case 'mistral':
155153
return MODEL_LIST.mistral[0];
156154
case 'deepseek':
157-
return MODEL_LIST.deepseek[0];
155+
return MODEL_LIST.deepseek[0];
158156
default:
159157
return MODEL_LIST.openai[0];
160158
}
@@ -242,6 +240,16 @@ export const configValidators = {
242240
return value;
243241
},
244242

243+
[CONFIG_KEYS.OCO_OMIT_SCOPE](value: any) {
244+
validateConfig(
245+
CONFIG_KEYS.OCO_OMIT_SCOPE,
246+
typeof value === 'boolean',
247+
'Must be boolean: true or false'
248+
);
249+
250+
return value;
251+
},
252+
245253
[CONFIG_KEYS.OCO_LANGUAGE](value: any) {
246254
const supportedLanguages = Object.keys(i18n);
247255

@@ -318,7 +326,7 @@ export const configValidators = {
318326
'test',
319327
'flowise',
320328
'groq',
321-
'deepseek'
329+
'deepseek'
322330
].includes(value) || value.startsWith('ollama'),
323331
`${value} is not supported yet, use 'ollama', 'mlx', 'anthropic', 'azure', 'gemini', 'flowise', 'mistral', 'deepseek' or 'openai' (default)`
324332
);
@@ -386,6 +394,7 @@ export type ConfigType = {
386394
[CONFIG_KEYS.OCO_AI_PROVIDER]: OCO_AI_PROVIDER_ENUM;
387395
[CONFIG_KEYS.OCO_GITPUSH]: boolean;
388396
[CONFIG_KEYS.OCO_ONE_LINE_COMMIT]: boolean;
397+
[CONFIG_KEYS.OCO_OMIT_SCOPE]: boolean;
389398
[CONFIG_KEYS.OCO_TEST_MOCK_TYPE]: string;
390399
[CONFIG_KEYS.OCO_ENABLE_LOGGING]?: boolean;
391400
[CONFIG_KEYS.OCO_ENABLE_CACHE]?: boolean;
@@ -437,11 +446,12 @@ export const DEFAULT_CONFIG = {
437446
OCO_ONE_LINE_COMMIT: false,
438447
OCO_TEST_MOCK_TYPE: 'commit-message',
439448
OCO_WHY: false,
440-
OCO_GITPUSH: true,
441449
OCO_ENABLE_LOGGING: true,
442450
OCO_ENABLE_CACHE: true,
443451
OCO_CACHE_DIR: '',
444452
OCO_LOG_DIR: ''
453+
OCO_OMIT_SCOPE: false,
454+
OCO_GITPUSH: true // todo: deprecate
445455
};
446456

447457
const initGlobalConfig = (configPath: string = defaultConfigPath) => {
@@ -479,6 +489,7 @@ const getEnvConfig = (envPath: string) => {
479489
OCO_PROMPT_MODULE: process.env.OCO_PROMPT_MODULE as OCO_PROMPT_MODULE_ENUM,
480490
OCO_ONE_LINE_COMMIT: parseConfigVarValue(process.env.OCO_ONE_LINE_COMMIT),
481491
OCO_TEST_MOCK_TYPE: process.env.OCO_TEST_MOCK_TYPE,
492+
OCO_OMIT_SCOPE: parseConfigVarValue(process.env.OCO_OMIT_SCOPE),
482493

483494
OCO_GITPUSH: parseConfigVarValue(process.env.OCO_GITPUSH),
484495
OCO_ENABLE_LOGGING: parseConfigVarValue(process.env.OCO_ENABLE_LOGGING),

src/i18n/cs.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
"localLanguage": "česky",
33
"commitFix": "fix(server.ts): zlepšení velikosti proměnné port na velká písmena PORT",
44
"commitFeat": "feat(server.ts): přidání podpory pro proměnnou prostředí process.env.PORT",
5-
"commitDescription": "Proměnná port se nyní jmenuje PORT, což odpovídá konvenci pojmenování, protože PORT je konstanta. Podpora proměnné prostředí process.env.PORT umožňuje snadnější správu nastavení při spuštění."
5+
"commitDescription": "Proměnná port se nyní jmenuje PORT, což odpovídá konvenci pojmenování, protože PORT je konstanta. Podpora proměnné prostředí process.env.PORT umožňuje snadnější správu nastavení při spuštění.",
6+
"commitFixOmitScope": "fix: zlepšení velikosti proměnné port na velká písmena PORT",
7+
"commitFeatOmitScope": "feat: přidání podpory pro proměnnou prostředí process.env.PORT"
68
}

src/i18n/de.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
"localLanguage": "Deutsch",
33
"commitFix": "fix(server.ts): Ändere die Groß- und Kleinschreibung der Port-Variable von Kleinbuchstaben auf Großbuchstaben PORT.",
44
"commitFeat": "Funktion(server.ts): Unterstützung für die Umgebungsvariable process.env.PORT hinzufügen",
5-
"commitDescription": "Die Port-Variable heißt jetzt PORT, was die Konsistenz mit den Namenskonventionen verbessert, da PORT eine Konstante ist. Die Unterstützung für eine Umgebungsvariable ermöglicht es der Anwendung, flexibler zu sein, da sie jetzt auf jedem verfügbaren Port laufen kann, der über die Umgebungsvariable process.env.PORT angegeben wird."
5+
"commitDescription": "Die Port-Variable heißt jetzt PORT, was die Konsistenz mit den Namenskonventionen verbessert, da PORT eine Konstante ist. Die Unterstützung für eine Umgebungsvariable ermöglicht es der Anwendung, flexibler zu sein, da sie jetzt auf jedem verfügbaren Port laufen kann, der über die Umgebungsvariable process.env.PORT angegeben wird.",
6+
"commitFixOmitScope": "fix: Ändere die Groß- und Kleinschreibung der Port-Variable von Kleinbuchstaben auf Großbuchstaben PORT.",
7+
"commitFeatOmitScope": "Funktion: Unterstützung für die Umgebungsvariable process.env.PORT hinzufügen"
68
}

src/i18n/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
"localLanguage": "english",
33
"commitFix": "fix(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics",
44
"commitFeat": "feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port",
5-
"commitDescription": "The port variable is now named PORT, which improves consistency with the naming conventions as PORT is a constant. Support for an environment variable allows the application to be more flexible as it can now run on any available port specified via the process.env.PORT environment variable."
5+
"commitDescription": "The port variable is now named PORT, which improves consistency with the naming conventions as PORT is a constant. Support for an environment variable allows the application to be more flexible as it can now run on any available port specified via the process.env.PORT environment variable.",
6+
"commitFixOmitScope": "fix: change port variable case from lowercase port to uppercase PORT to improve semantics",
7+
"commitFeatOmitScope": "feat: add support for process.env.PORT environment variable to be able to run app on a configurable port"
68
}

src/i18n/es_ES.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
"localLanguage": "spanish",
33
"commitFix": "fix(server.ts): cambiar la variable port de minúsculas a mayúsculas PORT",
44
"commitFeat": "feat(server.ts): añadir soporte para la variable de entorno process.env.PORT",
5-
"commitDescription": "La variable port ahora se llama PORT, lo que mejora la coherencia con las convenciones de nomenclatura, ya que PORT es una constante. El soporte para una variable de entorno permite que la aplicación sea más flexible, ya que ahora puede ejecutarse en cualquier puerto disponible especificado a través de la variable de entorno process.env.PORT."
5+
"commitDescription": "La variable port ahora se llama PORT, lo que mejora la coherencia con las convenciones de nomenclatura, ya que PORT es una constante. El soporte para una variable de entorno permite que la aplicación sea más flexible, ya que ahora puede ejecutarse en cualquier puerto disponible especificado a través de la variable de entorno process.env.PORT.",
6+
"commitFixOmitScope": "fix: cambiar la variable port de minúsculas a mayúsculas PORT",
7+
"commitFeatOmitScope": "feat: añadir soporte para la variable de entorno process.env.PORT"
68
}

src/i18n/fr.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
"localLanguage": "française",
33
"commitFix": "corriger(server.ts) : changer la casse de la variable de port de minuscules à majuscules (PORT)",
44
"commitFeat": "fonctionnalité(server.ts) : ajouter la prise en charge de la variable d'environnement process.env.PORT",
5-
"commitDescription": "La variable de port est maintenant nommée PORT, ce qui améliore la cohérence avec les conventions de nommage car PORT est une constante. La prise en charge d'une variable d'environnement permet à l'application d'être plus flexible car elle peut maintenant s'exécuter sur n'importe quel port disponible spécifié via la variable d'environnement process.env.PORT."
5+
"commitDescription": "La variable de port est maintenant nommée PORT, ce qui améliore la cohérence avec les conventions de nommage car PORT est une constante. La prise en charge d'une variable d'environnement permet à l'application d'être plus flexible car elle peut maintenant s'exécuter sur n'importe quel port disponible spécifié via la variable d'environnement process.env.PORT.",
6+
"commitFixOmitScope": "corriger : changer la casse de la variable de port de minuscules à majuscules (PORT)",
7+
"commitFeatOmitScope": "fonctionnalité : ajouter la prise en charge de la variable d'environnement process.env.PORT"
68
}

0 commit comments

Comments
 (0)