Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/agentready/assessors/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
38 changes: 38 additions & 0 deletions tests/unit/test_assessors_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down