Skip to main content

Module diff

Module diff 

Source
Expand description

Diff-aware analysis for PR workflows

This module provides functionality to filter findings to only those affecting lines changed in a PR/diff. This is useful for:

  • PR workflows where you only want to see new issues
  • Incremental analysis to reduce noise
  • CI pipelines that focus on changed code

Functions§

filter_findings_by_diff
Filter findings to only include those on changed lines
get_changed_lines_from_git
Get changed lines by running git diff against a base reference
get_changed_lines_from_stdin
Get changed lines from unified diff text read from stdin
is_file_changed
Check if a file is in the changed files set (regardless of line numbers)
parse_unified_diff
Parse a unified diff and extract the changed line numbers for each file

Type Aliases§

ChangedLines
Map of file paths to the set of line numbers that were changed