Lint Reports¶
Drape ingests lint results in SARIF format and tracks code quality across your repositories. It detects new violations introduced in PRs and posts comments highlighting them.
How It Works¶
- Run a linter that outputs SARIF (many linters support this via plugins or flags)
- Upload the SARIF file to Drape via the GitHub Action
- Drape tracks violations and posts PR comments with new issues
GitHub Action Setup¶
- name: Run linter
run: ruff check --output-format=sarif -o lint.sarif . || true
- name: Upload lint results
uses: drape-io/drape-action@v2
if: always()
continue-on-error: true
with:
command: lint
file: lint.sarif
api-key: ${{ secrets.DRAPE_API_KEY }}
Generating SARIF¶
Common linters with SARIF output:
| Linter | Command |
|---|---|
| Ruff (Python) | ruff check --output-format=sarif -o lint.sarif . |
| ESLint (JS/TS) | eslint -f @microsoft/eslint-formatter-sarif -o lint.sarif . |
| Clippy (Rust) | cargo clippy --message-format=json \| clippy-sarif > lint.sarif |
| golangci-lint (Go) | golangci-lint run --out-format sarif > lint.sarif |
| Zizmor (GitHub Actions) | zizmor --format sarif . > zizmor.sarif |
Any tool that produces SARIF output can be uploaded to Drape as a lint report.
PR Comments¶
The action posts a PR comment with:
- Total violation count with diff from base branch
- New violations with file path, line number, and rule details
- Resolved violations