файл пакета→ .shtukbase/packages/quality/checks/q04_contract.ts
checks/q04_contract.ts
16 строк, 1023 Б.
Файл как есть в пакете: код и комментарии в нём не переводятся.
- // QLT-R04. An indicator under the contract (scope: contract) that is not retired names the acceptance criterion
- // its threshold comes from (acceptance) and has a target.
- import type { Project, Result } from '../../collections/checks/lib/speclib.ts';
- import { main } from '../../collections/checks/lib/runner.ts';
- import { checkFields } from './lib/qlib.ts';
- export const RULE = { id: 'qlt-r04', title: 'A contract indicator refers to an acceptance criterion', scope: 'contract indicators, except derived ones' };
- export function check(p: Project, res: Result): void {
- checkFields(p, res, 'IND', [
- { when: (r) => String(r.fm.scope ?? '') === 'contract' && p.category(r, 'IND') !== 'dropped', fields: ['acceptance', 'target'],
- why: 'a contract indicator without an acceptance criterion or a target', fix: 'refer to an acceptance criterion (acceptance) and write the threshold in target, or make the indicator ours (scope: ours)', code: 'no-acceptance' },
- ]);
- }
- if (import.meta.main) main({ RULE, check });