From e8c955da4cbb042e6f9b89307d143f5bfa6779fa Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 31 Oct 2021 14:35:26 +0530 Subject: add `explain` subcommand and explanations to all lints --- bin/src/err.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bin/src/err.rs') diff --git a/bin/src/err.rs b/bin/src/err.rs index 4c16d69..1e52c2b 100644 --- a/bin/src/err.rs +++ b/bin/src/err.rs @@ -12,6 +12,8 @@ pub enum ConfigErr { InvalidPath(#[from] io::Error), #[error("unable to parse `{0}` as line and column")] InvalidPosition(String), + #[error("unable to parse `{0}` as warning code")] + InvalidWarningCode(String), } // #[derive(Error, Debug)] @@ -40,6 +42,12 @@ pub enum SingleFixErr { NoOp, } +#[derive(Error, Debug)] +pub enum ExplainErr { + #[error("lint with code `{0}` not found")] + LintNotFound(u32), +} + #[derive(Error, Debug)] pub enum StatixErr { // #[error("linter error: {0}")] @@ -50,4 +58,6 @@ pub enum StatixErr { Single(#[from] SingleFixErr), #[error("config error: {0}")] Config(#[from] ConfigErr), + #[error("explain error: {0}")] + Explain(#[from] ExplainErr), } -- cgit v1.2.3