@7n/rules 1.17.0 → 1.17.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/CHANGELOG.md
CHANGED
package/bin/n-rules.js
CHANGED
|
@@ -1802,7 +1802,8 @@ try {
|
|
|
1802
1802
|
verbose: args.includes('--verbose'),
|
|
1803
1803
|
files: pathFiles,
|
|
1804
1804
|
pathMode,
|
|
1805
|
-
repoWide
|
|
1805
|
+
repoWide,
|
|
1806
|
+
baseRef
|
|
1806
1807
|
}
|
|
1807
1808
|
const noFix = args.includes('--no-fix')
|
|
1808
1809
|
// Глобальна черга full-прогонів (spec 2026-07-03): одночасно виконується один
|
package/package.json
CHANGED
|
@@ -197,6 +197,7 @@ export async function buildDetectPlan(opts) {
|
|
|
197
197
|
explicitFiles: Array.isArray(opts.files) ? opts.files : null,
|
|
198
198
|
pathMode: opts.pathMode === true,
|
|
199
199
|
repoWide: opts.repoWide === true,
|
|
200
|
+
baseRef: typeof opts.baseRef === 'string' ? opts.baseRef : null,
|
|
200
201
|
cwd: opts.cwd
|
|
201
202
|
})
|
|
202
203
|
}
|
|
@@ -375,10 +376,20 @@ export function computeActiveDomains(byRule, enabledSet, changed) {
|
|
|
375
376
|
* @param {string[]|null} args.explicitFiles явний перелік файлів або null.
|
|
376
377
|
* @param {boolean} [args.pathMode] `--path`-дельта: лише per-file concerns.
|
|
377
378
|
* @param {boolean} [args.repoWide] `--repo-wide`: лише full-scope concerns, whole-repo.
|
|
379
|
+
* @param {string|null} [args.baseRef] явна база дельти (`--base <ref>`) замість каскаду main→origin/main.
|
|
378
380
|
* @param {string} args.cwd робоча директорія прогону.
|
|
379
381
|
* @returns {Promise<PlanItem[]>} впорядкований план прогону.
|
|
380
382
|
*/
|
|
381
|
-
async function buildPlan({
|
|
383
|
+
async function buildPlan({
|
|
384
|
+
byRule,
|
|
385
|
+
full,
|
|
386
|
+
rules,
|
|
387
|
+
explicitFiles,
|
|
388
|
+
pathMode = false,
|
|
389
|
+
repoWide = false,
|
|
390
|
+
baseRef = null,
|
|
391
|
+
cwd
|
|
392
|
+
}) {
|
|
382
393
|
// scoped + --path: per-file concerns названих правил × перетин path ∩ дельта
|
|
383
394
|
if (rules.length > 0 && explicitFiles !== null) return buildScopedDeltaPlan(byRule, rules, explicitFiles)
|
|
384
395
|
// scoped: усі lint-concerns названих правил, whole-repo
|
|
@@ -394,7 +405,7 @@ async function buildPlan({ byRule, full, rules, explicitFiles, pathMode = false,
|
|
|
394
405
|
if (full && explicitFiles === null) return buildFullPlan(byRule, enabledSet)
|
|
395
406
|
|
|
396
407
|
// delta / explicit-files; path-режим виключає full-scope concerns
|
|
397
|
-
const changed = explicitFiles ?? (await collectChangedFilesSince(await resolveChangedBase(cwd), cwd))
|
|
408
|
+
const changed = explicitFiles ?? (await collectChangedFilesSince(await resolveChangedBase(cwd, baseRef), cwd))
|
|
398
409
|
return buildDeltaPlan(byRule, enabledSet, changed, { perFileOnly: pathMode })
|
|
399
410
|
}
|
|
400
411
|
|
|
@@ -554,6 +565,7 @@ export async function detectAll(opts) {
|
|
|
554
565
|
explicitFiles,
|
|
555
566
|
pathMode: opts.pathMode === true,
|
|
556
567
|
repoWide: opts.repoWide === true,
|
|
568
|
+
baseRef: typeof opts.baseRef === 'string' ? opts.baseRef : null,
|
|
557
569
|
cwd
|
|
558
570
|
})
|
|
559
571
|
|