Start on existing code

A codebase that already has findings can start with a baseline, so that only new findings count. The team fixes the old ones when it chooses.

All docs pages

Write a baseline

tx0 baseline writes the current findings to tx0-baseline.txt, or to the file named by baseline in tx0.toml. From then on, tx0 check --new reports only findings that are not in it.

$ tx0 baseline
$ tx0 check --new

What counts as new

Findings are compared by rule and identity, not by line. Code that was moved or reformatted keeps its old findings out of the report; a change that makes old code unreachable shows up.

--new
findings that are not in the baseline
--changed
findings that are new in the changes not yet committed
--since REV
findings that are new since the git revision REV, as in a pull request (see CI)
--delta
compares with the previous check and lists what is new, what is still open and what was fixed

On the sample, after an edit to jobs/retry.py, --since HEAD reports only the finding in that file:

$ tx0 check --since HEAD
warning[tx0/python:duplicate-condition]: `status == 429` is tested earlier in this chain, so this branch never runs
 --> jobs/retry.py:6:10  74RVF0NHX
  |
6 |     elif status == 429:
  |          ^^^^^^^^^^^^^
2 |     if status == 429:
  |        ^^^^^^^^^^^^^ first tested here

1 findings in 1 files; 1 files checked, 1 from the cache, 0 findings suppressed