1use anyhow::Result;
2use qlty_types::tests::v1::FileCoverage;
3use std::path::Path;
4
5mod clover;
6mod cobertura;
7mod coverprofile;
8mod jacoco;
9mod lcov;
10mod qlty;
11mod simplecov;
12
13pub use clover::Clover;
14pub use cobertura::Cobertura;
15pub use coverprofile::Coverprofile;
16pub use jacoco::Jacoco;
17pub use lcov::Lcov;
18pub use qlty::Qlty;
19pub use simplecov::Simplecov;
20
21pub trait Parser {
22 fn parse_file(&self, path: &Path) -> Result<Vec<FileCoverage>> {
23 let text = std::fs::read_to_string(path)?;
24 self.parse_text(&text)
25 }
26
27 fn parse_text(&self, text: &str) -> Result<Vec<FileCoverage>>;
28}