@naturalcycles/dev-lib 20.22.2 → 20.23.0
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/cfg/summaryReporter.js +1 -1
- package/dist/commitlint.js +9 -0
- package/package.json +1 -1
package/cfg/summaryReporter.js
CHANGED
package/dist/commitlint.js
CHANGED
|
@@ -27,6 +27,11 @@ export async function runCommitlint() {
|
|
|
27
27
|
fs2.requireFileToExist(arg1);
|
|
28
28
|
const msg = fs2.readText(arg1);
|
|
29
29
|
console.log({ msg });
|
|
30
|
+
// Skip validation for merge commits (MERGE_HEAD exists during merge)
|
|
31
|
+
if (fs2.pathExists('.git/MERGE_HEAD')) {
|
|
32
|
+
console.log('✓ Merge commit - skipping validation');
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
30
35
|
const devLibCfg = await readDevLibConfigIfPresent();
|
|
31
36
|
console.log({ devLibCfg });
|
|
32
37
|
const { valid, errors } = validateCommitMessage(msg, devLibCfg.commitlint);
|
|
@@ -50,6 +55,10 @@ export function validateCommitMessage(input, cfg = {}) {
|
|
|
50
55
|
if (!msg) {
|
|
51
56
|
return { valid: false, errors: ['Commit message is empty'] };
|
|
52
57
|
}
|
|
58
|
+
// Allow merge commits generated by git
|
|
59
|
+
if (msg.startsWith('Merge ')) {
|
|
60
|
+
return { valid: true, errors: [] };
|
|
61
|
+
}
|
|
53
62
|
const lines = msg.split('\n');
|
|
54
63
|
const subjectLine = lines[0];
|
|
55
64
|
// Step 1: Validate subject line format
|