$schema: "@gobing-ai/spur/schemas/rule-file.schema.json"
# No focused or skipped tests committed to the suite.
# Part of the recommended-pre-check preset — caught BEFORE the suite runs so a
# narrowed or disabled test never lands on a branch and silently shrinks
# coverage.
#
# Scope: test files only (*.test.ts / *.test.tsx). The bare `.only(` / `.skip(`
# arms are safe here because the bun:test focus/skip API is the only thing in a
# test file that uses them; restricting scope avoids false positives on unrelated
# `.skip()` calls elsewhere. Pattern is ripgrep dialect (no lookbehind/backrefs).
include:
  - "apps/**/tests/**/*.test.ts"
  - "apps/**/tests/**/*.test.tsx"
  - "packages/**/tests/**/*.test.ts"
  - "packages/**/tests/**/*.test.tsx"
rules:
  - id: no-focused-or-skipped-tests
    description: >
      Do not commit focused (.only) or skipped (.skip) tests. They narrow or
      disable the suite, masking failures and coverage gaps. Remove the modifier
      before committing; quarantine flaky tests with a tracked issue instead.
    severity: error
    evaluator:
      type: rg
      config:
        pattern: "\\b(describe|it|test|bench)\\.(only|skip)\\(|\\b(fdescribe|fit|xdescribe|xit)\\("
