Skip to content

Refactor proposal: deduplicate language “coverage” CLI boilerplate (Go/Rust) #1213

@kunalsz

Description

@kunalsz

Issue / current state

The Go and Rust language coverage utilities (floss/language/go/coverage.py and floss/language/rust/coverage.py) contain near-identical CLI boilerplate: argument parsing , logging setup, and PE validation via pefile. This duplication increases maintenance cost and creates risk of subtle drift

Why this refactor is needed

  • Single source for shared CLI behavior reduces bugs and review overhead
  • Makes future language additions easier and more consistent.

How it will be done

Introduce a small helper module (floss/language/cli_common.py) that provides:

  • a function to add common argparse option
  • a function to configure logging consistently
  • a helper to open/validate PE input

@mr-tz Looking forward to your insights!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions