From 1a97cce01f8e49b33bf28cbcdfeb3c8aefd809a5 Mon Sep 17 00:00:00 2001 From: Akshay Date: Fri, 29 Oct 2021 18:20:54 +0530 Subject: report syntax errors as statix errors - statix now reports errors also, not just warnings - all diagnostics are available on stderr stream - non-utf8 files are skipped, does not eject early --- bin/src/err.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'bin/src/err.rs') diff --git a/bin/src/err.rs b/bin/src/err.rs index 53c3222..4c16d69 100644 --- a/bin/src/err.rs +++ b/bin/src/err.rs @@ -1,7 +1,7 @@ -use std::{io, path::PathBuf}; +use std::io; use globset::ErrorKind; -use rnix::parser::ParseError; +// use rnix::parser::ParseError; use thiserror::Error; #[derive(Error, Debug)] @@ -14,16 +14,16 @@ pub enum ConfigErr { InvalidPosition(String), } -#[derive(Error, Debug)] -pub enum LintErr { - #[error("[{0}] syntax error: {1}")] - Parse(PathBuf, ParseError), -} +// #[derive(Error, Debug)] +// pub enum LintErr { +// #[error("[{0}] syntax error: {1}")] +// Parse(PathBuf, ParseError), +// } #[derive(Error, Debug)] pub enum FixErr { - #[error("[{0}] syntax error: {1}")] - Parse(PathBuf, ParseError), + // #[error("[{0}] syntax error: {1}")] + // Parse(PathBuf, ParseError), #[error("path error: {0}")] InvalidPath(#[from] io::Error), } @@ -42,8 +42,8 @@ pub enum SingleFixErr { #[derive(Error, Debug)] pub enum StatixErr { - #[error("linter error: {0}")] - Lint(#[from] LintErr), + // #[error("linter error: {0}")] + // Lint(#[from] LintErr), #[error("fixer error: {0}")] Fix(#[from] FixErr), #[error("single fix error: {0}")] -- cgit v1.2.3