From 3c35eb1ae49e7ed98cc996e46ec37d7c42edf7bc Mon Sep 17 00:00:00 2001 From: YuniorGlez Date: Sat, 8 Aug 2026 13:22:14 +0100 Subject: [PATCH] feat: recognize bunx oxlint and versioned bunx tsc in single-file verification Bun-based TypeScript projects document single-file checks as `bunx oxlint ` and `bunx tsc@7 --noEmit ` (TS7 ships as `tsc@7` via bunx). Neither matched the existing patterns: - `oxlint` was missing from the lint patterns entirely. - `tsc --noEmit ` required the literal `tsc` binary; the versioned `tsc@7` form (standard with TS7/Go ports) was missed. - Add `(?:bunx\s+)?oxlint ` lint pattern. - Add `(?:bunx\s+)?tsc@ --noEmit ` typecheck pattern. - Unit tests: bunx oxlint, versioned bunx tsc, and full-score combo. --- src/agentready/assessors/verification.py | 2 ++ tests/unit/test_assessors_verification.py | 38 +++++++++++++++++++++++ 2 files changed, 40 insertions(+) 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"