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;
9use crate::rule_selection::RuleSelection;
10
11// The threshold is an OffenceThreshold rather than a bare usize precisely so
12// this can stay derived. A usize field would default to zero, which this tool
13// reads as "no limit" -- the opposite of the CLI default, and a mismatch that
14// would only surface on a codebase big enough to need the cap.
15#[derive(Debug, Clone, Default, PartialEq, Eq)]
16pub struct Config {
17    pub manifest_path: Option<PathBuf>,
18    pub packages: Vec<String>,
19    pub expected_header: Vec<String>,
20    pub format: OutputFormat,
21    pub offence_threshold: OffenceThreshold,
22    pub selection: RuleSelection,
23}