Skip to main content

stern4rust/
config.rs

1// Copyright 2025 Umberto Gotti <umberto.gotti@umbertogotti.dev>
2// Licensed under the MIT License
3// SPDX-License-Identifier: MIT
4
5use std::path::PathBuf;
6
7use crate::offence_threshold::OffenceThreshold;
8use crate::output_format::OutputFormat;
9
10// The threshold is an OffenceThreshold rather than a bare usize precisely so
11// this can stay derived. A usize field would default to zero, which this tool
12// reads as "no limit" -- the opposite of the CLI default, and a mismatch that
13// would only surface on a codebase big enough to need the cap.
14#[derive(Debug, Clone, Default, PartialEq, Eq)]
15pub struct Config {
16    pub manifest_path: Option<PathBuf>,
17    pub packages: Vec<String>,
18    pub expected_header: Vec<String>,
19    pub format: OutputFormat,
20    pub offence_threshold: OffenceThreshold,
21}