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
3 changes: 2 additions & 1 deletion src/agentready/assessors/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ def _assess_quality_gates(self, ci_configs: list) -> tuple:
gate_score: 0-30
"""
lint_patterns = [
r"(?:eslint|ruff|pylint|flake8|rubocop|golangci-lint|black|isort|prettier|stylelint)\b",
r"(?:eslint|ruff|pylint|flake8|rubocop|golangci-lint|black|isort|prettier|stylelint|oxlint)\b",
r"\blint\b",
r"\bformatting?\b",
r"\bcargo\s+clippy\b",
Expand All @@ -1143,6 +1143,7 @@ def _assess_quality_gates(self, ci_configs: list) -> tuple:
r"\bmocha\b",
r"\bnpm\s+test\b",
r"\byarn\s+test\b",
r"\bbun\s+run\s+test\b",
r"(?:\bgo|\$\(GO\))\s+test\b",
r"\bcargo\s+test\b",
r"\brspec\b",
Expand Down
25 changes: 25 additions & 0 deletions tests/unit/test_assessors_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,31 @@ def test_all_three_gates_passes(self, tmp_path):
assert finding.status == "pass"
assert finding.score >= 75

def test_bun_workflow_passes(self, tmp_path):
"""Test pass when a Bun-based workflow has all three gates on PRs."""
workflows_dir = tmp_path / ".github" / "workflows"
workflows_dir.mkdir(parents=True)
(workflows_dir / "ci.yml").write_text(
"name: CI\n"
"on: [push, pull_request]\n"
"jobs:\n"
" quality:\n"
" runs-on: ubuntu-latest\n"
" steps:\n"
" - uses: oven-sh/setup-bun@v2\n"
" - run: bun install --frozen-lockfile\n"
" - run: bun run lint\n"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Exercise the new oxlint detection.

bun run lint matches the existing \blint\b pattern. This test therefore passes even if the new oxlint alternative is removed. Replace or supplement this step with the repository’s supported command containing oxlint, while keeping bun run test to cover both new patterns.

As per path instructions, tests must verify the intended behavior and missing edge cases.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/test_assessors_testing.py` at line 579, Update the test fixture in
the assessor test to include the repository-supported lint command containing
“oxlint,” rather than relying only on “bun run lint.” Keep “bun run test” in the
steps so the test exercises both detection patterns and would fail if the oxlint
alternative were removed.

Source: Path instructions

" - run: bun run test\n"
" - run: bunx tsc@7 --noEmit\n"
)

repo = _make_repo(tmp_path)
assessor = CIQualityGatesAssessor()
finding = assessor.assess(repo)

assert finding.status == "pass"
assert finding.score >= 75

def test_push_only_workflow_fails(self, tmp_path):
"""Test that push-only workflows fail even with all three gates."""
workflows_dir = tmp_path / ".github" / "workflows"
Expand Down