pub struct Config {Show 14 fields
pub table: Option<bool>,
pub ext: Option<BTreeMap<String, Vec<String>>>,
pub exclude: Option<Vec<String>>,
pub languages: Option<Vec<String>>,
pub exclude_languages: Option<Vec<String>>,
pub max_cognitive: Option<u32>,
pub max_cyclomatic: Option<u32>,
pub min: Option<u32>,
pub no_ignore: Option<bool>,
pub jobs: Option<u32>,
pub pretty: Option<bool>,
pub cache: Option<bool>,
pub cache_file: Option<PathBuf>,
pub source_dir: Option<PathBuf>,
}Expand description
The deserialized cccc.toml. Every field is optional; an absent field means
“defer to the CLI flag or the built-in default”. Unknown keys are rejected so
typos surface as errors instead of being silently ignored.
Fields§
§table: Option<bool>Print a human-readable table instead of JSON.
ext: Option<BTreeMap<String, Vec<String>>>Per-language file-extension overrides, e.g. [ext] with es = ["ts"].
Each entry replaces that language’s default extensions (and so also
routes those extensions to it). Keyed by a language’s canonical name or
an alias. Languages without an entry keep their defaults.
exclude: Option<Vec<String>>Glob patterns of files to exclude.
languages: Option<Vec<String>>Languages to analyze (canonical names or aliases).
exclude_languages: Option<Vec<String>>Languages to exclude from analysis (the inverse of languages).
max_cognitive: Option<u32>Fail if any function’s cognitive complexity exceeds this.
max_cyclomatic: Option<u32>Fail if any function’s cyclomatic complexity exceeds this.
min: Option<u32>Only report functions whose complexity is >= this.
no_ignore: Option<bool>Do not respect .gitignore / ignore files.
jobs: Option<u32>Number of files to analyze in parallel.
pretty: Option<bool>Pretty-print the JSON output (the default is compact, one line).
cache: Option<bool>Cache results and reuse them for files unchanged since the last run.
cache_file: Option<PathBuf>Where to keep the results cache (default: .cccc.cache next to this
config file). Does not enable caching by itself.
source_dir: Option<PathBuf>Directory containing the loaded config file. Not a config key — filled in at load time so the default cache location can sit beside the file.
Implementations§
Source§impl Config
impl Config
Sourcepub fn resolve(
explicit: Option<&Path>,
no_config: bool,
) -> Result<Config, String>
pub fn resolve( explicit: Option<&Path>, no_config: bool, ) -> Result<Config, String>
Resolve the config for this run, honoring --config / --no-config.
--no-config(no_config = true): always returns an empty config.--config <path>(explicit = Some): loads exactly that file; a missing or malformed file is an error.- neither: discovers a file by walking up from the current directory, returning the empty config if none is found.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Forget for Config
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more