Skip to main content

A SonarQube-like static analysis CLI for Python projects.

Project description

supersonar

supersonar is a lightweight, SonarQube-inspired static analysis CLI for Python projects. It is designed for local use and CI pipelines via pip install.

Quick start

pip install .
supersonar scan . --format json

The scanner performs real code checks (AST + regex), including:

  • dynamic execution (eval/exec)
  • broad exception handlers
  • hardcoded secret-like assignments
  • TODO/FIXME markers

CI usage

pip install supersonar
supersonar scan . \
  --format sarif \
  --out reports/supersonar.sarif \
  --fail-on high \
  --max-high 0 \
  --max-critical 0 \
  --coverage-xml coverage.xml \
  --min-coverage 80

Config (supersonar.toml)

[scan]
exclude = [".git", ".venv", "venv", "build", "dist", "__pycache__"]
coverage_xml = "coverage.xml"

[quality_gate]
fail_on = "high"
max_issues = 200
max_high = 0
max_critical = 0
min_coverage = 80.0

[report]
format = "json"

Quality gates

  • fail_on: fail if any issue exists at/above severity
  • max_issues: fail if total issues exceed threshold
  • max_low, max_medium, max_high, max_critical: per-severity caps
  • min_coverage: minimum line coverage percentage from Cobertura XML

Generate coverage.xml in Python projects with:

python -m pip install coverage
coverage run -m pytest
coverage xml -o coverage.xml

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

supersonar-0.2.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

supersonar-0.2.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file supersonar-0.2.0.tar.gz.

File metadata

  • Download URL: supersonar-0.2.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for supersonar-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2c434ee83216c4521960b972bb883eee6850e20b43c6d3785ac79449c42b3914
MD5 9a54e082982aa54f063e4fff1810c701
BLAKE2b-256 be9e4acd617d3aa3a0b8e10064dc09a2534fcf175e5ce8aa479b4e654e2b0075

See more details on using hashes here.

File details

Details for the file supersonar-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: supersonar-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for supersonar-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ffadb2a19817a92b47c7644d95c0f783ab73ffabd378cb7ab129143ecaec9fe0
MD5 6af758d83b0406b414d42844362650d8
BLAKE2b-256 e6d1dc590de890c4fec1a8cfb4c7152e021d67c0a0171a7610d31a2cd958608f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page