Skip to main content

Module text

Module text 

Source
Expand description

Line-level detectors over the base and head text of one changed file.

The detectors are syntactic. They compare token counts and added lines, and they do not parse the file. A line counts as added when its trimmed text occurs more often in head than in base, so a moved line is not added.

Structs§

LineHit
One detector hit on a head line.

Functions§

added_lines
Lines of head that do not occur in base, as (1-based line, text).
added_suppression_hits
Added comment lines that add a suppression.
assertion_count
The number of assertion calls (expect(, assert, should) in a test file, comments excluded.
code_identifiers
The identifier tokens in the code of src. Comments and the content of string literals do not count, so a word in a test title or a comment is not an identifier. A token that starts with a digit is a number.
is_coverage_config_path
Whether rel_path names a test-runner, coverage or Fallow config file.
removed_assertion_lines
The code lines that the change removed from a file, as (assertion lines, code lines). Comment and blank lines do not count.
skip_only_hits
Added lines of a test file that add a skip or focus marker.
test_case_count
The number of test-case calls in a test file, comments excluded.
test_only_branch_hits
Added lines of a non-test source file that branch on the test environment.
weakened_threshold_hits
Threshold values in a coverage or quality config that the change made less strict. Occurrences of one key pair up in file order.