INNER CODE UNIT · Python

get_deleted_ids

panther-labs/panther-analysis · .scripts/deleted_rules.py:16

def get_deleted_ids() -> set[str]:
    # Run git diff, get output
    result = subprocess.run(
        ["git", "diff", "origin/develop", "HEAD"], capture_output=True
    )
    if result.stderr:
        raise Exception(result.stderr.decode("utf-8"))

    # Track specific IDs that are added and deleted
    added_ids = set()
    deleted_ids = set()

    for line in result.stdout.decode("utf-8").split("\n"):
        if m := diff_pattern.match(line):
            id_value = m.group(1)
            if line.startswith("+"):
                added_ids.add(id_value)
            elif line.startswith("-"):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…