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 crate::offence_threshold::OffenceThreshold;
6use crate::output_format::OutputFormat;
7use crate::rule_selection::RuleSelection;
8use std::path::PathBuf;
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 baseline: Option<PathBuf>,
17    pub config_file: Option<PathBuf>,
18    pub fix: bool,
19    pub write_baseline: bool,
20    pub manifest_path: Option<PathBuf>,
21    pub packages: Vec<String>,
22    pub excludes: Vec<String>,
23    pub expected_header: Vec<String>,
24    pub format: OutputFormat,
25    pub offence_threshold: OffenceThreshold,
26    pub selection: RuleSelection,
27}