chore: standardize pre-commit checks

This commit is contained in:
Andrey Avtomonov 2026-05-12 13:02:06 +02:00
parent c35297b80a
commit 52400c599c
3 changed files with 87 additions and 14 deletions

View file

@ -12,7 +12,16 @@ describe('precommit-check', () => {
assert.deepEqual(commandKeys(['outside-workspace/src/app.ts']), []);
});
it('runs only the touched package checks for package code', () => {
it('runs only the touched package checks for standalone package paths', () => {
assert.deepEqual(commandKeys(['packages/cli/src/index.ts']), [
'boundary-check',
'type-check:@ktx/cli',
'build:@ktx/cli',
'test:@ktx/cli',
]);
});
it('accepts legacy subtree-prefixed package paths', () => {
assert.deepEqual(commandKeys(['ktx/packages/cli/src/index.ts']), [
'boundary-check',
'type-check:@ktx/cli',
@ -22,12 +31,12 @@ describe('precommit-check', () => {
});
it('runs the matching script test when a script changes', () => {
assert.deepEqual(commandKeys(['ktx/scripts/check-boundaries.mjs']), [
assert.deepEqual(commandKeys(['scripts/check-boundaries.mjs']), [
'script-test:scripts/check-boundaries.test.mjs',
]);
});
it('runs the touched python package tests', () => {
assert.deepEqual(commandKeys(['ktx/python/ktx-sl/semantic_layer/parser.py']), ['pytest:ktx-sl']);
assert.deepEqual(commandKeys(['python/ktx-sl/semantic_layer/parser.py']), ['pytest:ktx-sl']);
});
});