ShtukbaseStandard
包文件→ .shtukbase/packages/live/checks/lib.ts

checks/lib.ts

14 行, 756 B.

文件按包中的原样显示:代码及其注释不做翻译。

  1. // Shared part of the live checks: the problems of /base/live.md for one norm, as findings of a rule.
  2. import { type Project, type Result } from '../../collections/checks/lib/speclib.ts';
  3. import { PAGE, readSettings } from '../server/settings.ts';
  4. export { main } from '../../collections/checks/lib/runner.ts';
  5. /** Findings of the norm `rule` (LIVE-R0n) in the settings page; returns the settings for more checks. */
  6. export function settingsFindings(p: Project, res: Result, rule: string, fix: string) {
  7. const s = readSettings(p.root);
  8. res.scope = [PAGE];
  9. res.part('live server settings', null);
  10. for (const x of s.problems.filter((x) => x.includes(`(${rule})`))) res.hole(PAGE, x.replace(` (${rule})`, ''), fix, rule.toLowerCase());
  11. return s;
  12. }