gennady 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/gennady.js +2 -0
- package/package.json +1 -1
- package/src/commit-gen/commit-gen.js +10 -8
package/cli/gennady.js
CHANGED
package/package.json
CHANGED
|
@@ -85,13 +85,15 @@ export class CommitGen {
|
|
|
85
85
|
const maxTokens = codeChanged[codeChanged.length - 1].tokens;
|
|
86
86
|
const languages = [...new Set(codeChanged.map(f => f.programmingLanguage).filter(Boolean))].join(', ');
|
|
87
87
|
const mode =
|
|
88
|
-
this.init.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
88
|
+
this.init.oneline
|
|
89
|
+
? 'oneline'
|
|
90
|
+
: this.init.mode === 'auto'
|
|
91
|
+
? this.init.targetBranch
|
|
92
|
+
? 'detailed'
|
|
93
|
+
: commitCount > 1 && codeChanged.length < 5
|
|
94
|
+
? 'oneline'
|
|
95
|
+
: 'detailed'
|
|
96
|
+
: this.init.mode;
|
|
95
97
|
|
|
96
98
|
this.logger.info(`- Mode: ${style.bold.magentaBright(mode)}`);
|
|
97
99
|
this.logger.info(`- Languages: ${style.yellow(languages)}`);
|
|
@@ -139,7 +141,7 @@ export class CommitGen {
|
|
|
139
141
|
|
|
140
142
|
const startFormatTime = performance.now();
|
|
141
143
|
const formatted = await this.toFormat(
|
|
142
|
-
mode === 'detailed'
|
|
144
|
+
mode === 'detailed' ? this.init.formatDetailedPromptTemplate : this.init.formatOnelinePromptTemplate,
|
|
143
145
|
results.join('\n\n'),
|
|
144
146
|
);
|
|
145
147
|
this.logger.info(`- Formatting time: ${style.blueBright(((performance.now() - startFormatTime) / 1000).toFixed(2))}s`);
|