1use std::{io, path::PathBuf};
4
5#[derive(Clone, Debug, thiserror::Error)]
7pub enum ConfigError {
8 #[error("`{0}` does not exist.")]
10 DoesNotExist(PathBuf),
11
12 #[error("`{0}` is not a file.")]
14 NotAFile(PathBuf),
15
16 #[error("Input error `{1}` while trying to read the contents of `{0}`.")]
18 IoError(PathBuf, io::ErrorKind),
19
20 #[error("Could not parse the contents of `{0}`. {1}.")]
22 DeserializationError(PathBuf, String),
23
24 #[error("Regular expression `{value}` for `{name}` produced an error. Please check that this value is a valid regular expression. See https://docs.rs/regex/latest/regex/#examples for examples.")]
26 RegexError { name: String, value: String },
27
28 #[error("Unknown lint type: `{0}`. Please double check the spelling, or consult the documentation for all the available lint codes.")]
31 UnknownLintCode(String),
32}