aboutsummaryrefslogtreecommitdiff
path: root/bin/src/err.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-10-29 13:50:54 +0100
committerAkshay <[email protected]>2021-10-29 14:14:14 +0100
commit1a97cce01f8e49b33bf28cbcdfeb3c8aefd809a5 (patch)
tree62613f193d84ea8b0c0aa94d09758fee19a6042d /bin/src/err.rs
parentd510714ed5a1eae0f6e5e435e4cff4875b06751d (diff)
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
Diffstat (limited to 'bin/src/err.rs')
-rw-r--r--bin/src/err.rs22
1 files changed, 11 insertions, 11 deletions
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 @@
1use std::{io, path::PathBuf}; 1use std::io;
2 2
3use globset::ErrorKind; 3use globset::ErrorKind;
4use rnix::parser::ParseError; 4// use rnix::parser::ParseError;
5use thiserror::Error; 5use thiserror::Error;
6 6
7#[derive(Error, Debug)] 7#[derive(Error, Debug)]
@@ -14,16 +14,16 @@ pub enum ConfigErr {
14 InvalidPosition(String), 14 InvalidPosition(String),
15} 15}
16 16
17#[derive(Error, Debug)] 17// #[derive(Error, Debug)]
18pub enum LintErr { 18// pub enum LintErr {
19 #[error("[{0}] syntax error: {1}")] 19// #[error("[{0}] syntax error: {1}")]
20 Parse(PathBuf, ParseError), 20// Parse(PathBuf, ParseError),
21} 21// }
22 22
23#[derive(Error, Debug)] 23#[derive(Error, Debug)]
24pub enum FixErr { 24pub enum FixErr {
25 #[error("[{0}] syntax error: {1}")] 25 // #[error("[{0}] syntax error: {1}")]
26 Parse(PathBuf, ParseError), 26 // Parse(PathBuf, ParseError),
27 #[error("path error: {0}")] 27 #[error("path error: {0}")]
28 InvalidPath(#[from] io::Error), 28 InvalidPath(#[from] io::Error),
29} 29}
@@ -42,8 +42,8 @@ pub enum SingleFixErr {
42 42
43#[derive(Error, Debug)] 43#[derive(Error, Debug)]
44pub enum StatixErr { 44pub enum StatixErr {
45 #[error("linter error: {0}")] 45 // #[error("linter error: {0}")]
46 Lint(#[from] LintErr), 46 // Lint(#[from] LintErr),
47 #[error("fixer error: {0}")] 47 #[error("fixer error: {0}")]
48 Fix(#[from] FixErr), 48 Fix(#[from] FixErr),
49 #[error("single fix error: {0}")] 49 #[error("single fix error: {0}")]