@scalequality/check
v0.4.0
Published
ScaleQuality continuous code-maturity check for CI. Re-measures your repo on every build and fails the pipeline below your maturity line.
Maintainers
Readme
@scalequality/check
Continuous code-maturity gate for CI. On every build it asks ScaleQuality to re-measure your repo and fails the pipeline when maturity drops below your line, so quality regressions are caught before they merge.
npx @scalequality/check --token "$SQ_TOKEN" --project <projectId>Get your token and project id from ScaleQuality: open a connected repo's diagnosis
and Turn on continuous measurement. Store the token as a CI secret named
SQ_TOKEN.
Options
| Flag | Env | Default | Meaning |
|------|-----|---------|---------|
| --token | SQ_TOKEN | — | Your SQ token (required) |
| --project | SQ_PROJECT | — | ScaleQuality project id (required) |
| --host | SQ_HOST | https://app.scalequality.io | API host |
| --timeout | — | 600 | Max seconds to wait for the measurement |
| --json | — | off | Print the raw result as JSON |
Exit codes: 0 passed (or track-only), 1 below the cutoff, 2 error.
CI examples
GitHub Actions (a step in your job):
- run: npx @scalequality/check --token "$SQ_TOKEN" --project <projectId>
env:
SQ_TOKEN: ${{ secrets.SQ_TOKEN }}GitLab CI:
scalequality:
image: node:20
script:
- npx @scalequality/check --token "$SQ_TOKEN" --project <projectId>Any other CI: run the same npx @scalequality/check command, with SQ_TOKEN
exposed as a secret/variable.
Measured coverage
Coverage is only real once the tests have run. If this job produces a coverage report, the check finds it and ScaleQuality shows measured line coverage instead of a directional estimate. Nothing to configure: run your tests with coverage before this step.
- run: mvn verify # writes target/site/jacoco/jacoco.xml
- run: npx @scalequality/check --token "$SQ_TOKEN" --project <projectId>Recognised out of the box: JaCoCo (jacoco.xml), LCOV (lcov.info), Cobertura
(coverage.xml, coverage.cobertura.xml), Istanbul (coverage-summary.json),
Clover (clover.xml) and Go (coverage.out). Multi-module builds are summed.
The reports are copied into a temporary .sqreports/ folder so they survive the
archive's build-output exclusions, and that folder is removed before the command
exits — including when the job is cancelled.
Report somewhere unusual? Point at it in scalequality.properties at the repo
root:
sq.coverage.reportPaths=ops/reports/jacoco-aggregate.xmlFull guide: https://scalequality.io/docs/continuous-measurement
