Modular code analysis that runs in your CI/CD pipeline. Install only the analyzers you need. Produces standard JUnit XML reports and optionally sends results to the Gitrevio API for historical tracking.
Every commit, two core jobs always run (zero dependencies):
| Job | What it does |
|---|---|
| git_ls | Lists modified files |
| git_stats | Additions, deletions, file types, folder breakdown |
On top of that, pluggable analyzers run based on what's installed:
| Analyzer | Languages | Install |
|---|---|---|
| lizard | Python, JS/TS, Java, C/C++, C#, Go, Ruby | pip install 'gitrevio[ci-lizard]' |
| ruff | Python | pip install 'gitrevio[ci-ruff]' |
| eslint | JS/TS | npm install -g eslint |
| go_vet | Go | (ships with Go) |
Only analyzers whose tools are installed AND whose file extensions match modified files will run. No configuration needed.
name: Gitrevio Analysis
on: [push, pull_request]
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-python@v5
with:
python-version: "3.11"
# Install for your stack:
- run: pip install 'gitrevio[ci-lizard]'
# Python + linting: pip install 'gitrevio[ci-lizard,ci-ruff]'
# JS/TS: npm install -g eslint
- run: gitrevio-analyze --commit ${{ github.sha }}
env:
GITREVIO_API_URL: ${{ secrets.GITREVIO_API_URL }}
GITREVIO_TOKEN: ${{ secrets.GITREVIO_TOKEN }}
GITREVIO_CUSTOMER: ${{ secrets.GITREVIO_CUSTOMER }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: gitrevio-report
path: gitrevio-junit.xmlAdd to your .gitlab-ci.yml:
include:
- remote: 'https://raw.githubusercontent.com/Flexiana/gitrevio-playground/simplify_gitrevio3/gitrevio3/localgit/ci-templates/gitlab-ci.yml'Set GITREVIO_TOKEN and GITREVIO_CUSTOMER in Settings > CI/CD > Variables.
pip install 'gitrevio[ci-lizard]'
gitrevio-analyze --commit $COMMIT_SHAOutput files:
gitrevio-junit.xml— point your CI's JUnit report parser at thisgitrevio-results.json— raw analysis data
| Flag / Env var | Default | Description |
|---|---|---|
--commit |
HEAD | Commit SHA to analyze |
--threshold / GITREVIO_CCN_THRESHOLD |
15 | CCN threshold for failures |
--analyzers / GITREVIO_ANALYZERS |
auto-detect | Comma-separated analyzer names |
--list |
— | List available analyzers and exit |
--api-url / GITREVIO_API_URL |
— | Gitrevio API endpoint |
--token / GITREVIO_TOKEN |
— | API authentication token |
--customer / GITREVIO_CUSTOMER |
— | Customer slug |
--output-dir |
. | Where to write output files |
Drop a Python file in analyzers/ with this interface:
NAME = "my_tool"
DESCRIPTION = "What it does"
EXTENSIONS = {".py", ".go"}
DEPS = ["my-tool-cli"]
def available() -> bool:
"""Return True if the tool is installed."""
def run(files, commit_sha, repo_root):
"""Run analysis. Return dict with raw_output, findings, summary."""No other changes needed — the plugin system auto-discovers it.