Skip to main content

Module diff_risk

Module diff_risk 

Source
Expand description

Diff-risk rules of fallow audit.

The rules compare the base and head text of each changed file. They report a fact about the change, so every finding is introduced. The pass reads the base text through one git cat-file --batch process at the merge base of the base ref and HEAD.

  • weakened-tests: a new skip or focus marker, fewer test cases across the changed test files, fewer assertions in a test file, or a less strict coverage threshold.
  • added-suppression: a new lint, type-check, coverage or Fallow suppression comment.
  • test-only-branch: a new test-environment branch in a non-test source file.
  • diverged-clone-sibling: one copy of a base clone group was edited out of the group, and no sibling changed. Needs the base snapshot.
  • added-dependency: a new package.json dependency. Off by default.

Modules§

clones
diverged-clone-sibling: the change edited one copy of a base clone group, that copy no longer matches, and no sibling changed.
text
Line-level detectors over the base and head text of one changed file.

Structs§

DiffRiskInput
Inputs of one diff-risk pass.

Enums§

DiffRiskRules
Where the rule severities come from.

Functions§

clone_spans
The instance locations of a clone group, relative to root.
detect
Run every diff-risk rule over the changed files.