diff --git a/src/agentready/assessors/verification.py b/src/agentready/assessors/verification.py index d10a8ae1..eea13c3c 100644 --- a/src/agentready/assessors/verification.py +++ b/src/agentready/assessors/verification.py @@ -51,11 +51,13 @@ def attribute(self) -> Attribute: (r"golangci-lint\s+run\s+(?!-)[\w./\-]*\.\w{1,10}(?=\s*(?:[`\n]|$))", "lint"), (r"black\s+--check\s+(?!-)[\w./\-]*\.\w{1,10}(?=\s*(?:[`\n]|$))", "lint"), (r"prettier\s+--check\s+(?!-)[\w./\-]*\.\w{1,10}(?=\s*(?:[`\n]|$))", "lint"), + (r"(?:bunx\s+)?oxlint\s+(?!-)[\w./\-]*\.\w{1,10}(?=\s*(?:[`\n]|$))", "lint"), (r"gofmt\s+(?!-)[\w./\-]*\.\w{1,10}(?=\s*(?:[`\n]|$))", "lint"), # Type check single file patterns (r"mypy\s+(?!-)[\w./\-]*\.\w{1,10}(?=\s*(?:[`\n]|$))", "typecheck"), (r"pyright\s+(?!-)[\w./\-]*\.\w{1,10}(?=\s*(?:[`\n]|$))", "typecheck"), (r"tsc\s+--noEmit\s+(?!-)[\w./\-]*\.\w{1,10}(?=\s*(?:[`\n]|$))", "typecheck"), + (r"(?:bunx\s+)?tsc@\d+(?:\.\d+)*\s+--noEmit\s+(?!-)[\w./\-]*\.\w{1,10}(?=\s*(?:[`\n]|$))", "typecheck"), ] def assess(self, repository: Repository) -> Finding: diff --git a/tests/unit/test_assessors_verification.py b/tests/unit/test_assessors_verification.py index c560db65..2b196948 100644 --- a/tests/unit/test_assessors_verification.py +++ b/tests/unit/test_assessors_verification.py @@ -136,6 +136,44 @@ def test_recognizes_golangci_lint(self, tmp_path): assert finding.score >= 50.0 + def test_recognizes_bunx_oxlint(self, tmp_path): + """Test that bunx oxlint pattern is recognized as lint.""" + claude_md = tmp_path / "CLAUDE.md" + claude_md.write_text("Run `bunx oxlint src/lib/site.ts` to lint.\n") + + repo = self._make_repo(tmp_path) + assessor = SingleFileVerificationAssessor() + finding = assessor.assess(repo) + + assert finding.score >= 50.0 + + def test_recognizes_bunx_tsc_versioned(self, tmp_path): + """Test that versioned bunx tsc (tsc@7) pattern is recognized as typecheck.""" + claude_md = tmp_path / "CLAUDE.md" + claude_md.write_text("Run `bunx tsc@7 --noEmit src/lib/site.ts` to type-check.\n") + + repo = self._make_repo(tmp_path) + assessor = SingleFileVerificationAssessor() + finding = assessor.assess(repo) + + assert finding.score >= 50.0 + + def test_full_score_with_bun_commands(self, tmp_path): + """Test that bunx oxlint + bunx tsc@7 together give full score.""" + claude_md = tmp_path / "CLAUDE.md" + claude_md.write_text( + "# Commands\n" + "- Lint: `bunx oxlint src/lib/site.ts`\n" + "- Type check: `bunx tsc@7 --noEmit src/lib/site.ts`\n" + ) + + repo = self._make_repo(tmp_path) + assessor = SingleFileVerificationAssessor() + finding = assessor.assess(repo) + + assert finding.status == "pass" + assert finding.score == 100.0 + def test_recognizes_pyright(self, tmp_path): """Test that pyright pattern is recognized as typecheck.""" claude_md = tmp_path / "CLAUDE.md"