# Example: Wrapped validation
# Wraps an existing tool and transforms its output into a pass/fail result.

name: qa/lint-check
description: Validate that linting passes by wrapping the lint tool
wraps: devops/run-linter
mode: required
transform: |
  def transform(result):
    errors = result.get("errors", [])
    passed = len(errors) == 0
    return {
      "passed": passed,
      "data": {"error_count": len(errors), "errors": errors[:5]},
      "message": f"{len(errors)} lint errors found" if errors else "No lint errors"
    }

argument_mapping:
  strict: true
  config_path: .eslintrc.json

resource_slots:
  - name: source_code
    resource_type: git-checkout
    access: read_only
    description: Source code to lint
    binding: contextual

timeout: 180
