From 4e063b2abc402ac4d6902647e821978269025c7d Mon Sep 17 00:00:00 2001 From: Akshay Date: Wed, 3 Nov 2021 14:48:35 +0530 Subject: add snapshot test suite --- bin/src/config.rs | 14 +++++++------- bin/src/lib.rs | 7 +++++++ bin/src/main.rs | 18 ++++++------------ 3 files changed, 20 insertions(+), 19 deletions(-) create mode 100644 bin/src/lib.rs (limited to 'bin/src') diff --git a/bin/src/config.rs b/bin/src/config.rs index 25c2a7f..d3944ac 100644 --- a/bin/src/config.rs +++ b/bin/src/config.rs @@ -2,17 +2,17 @@ use std::{default::Default, fmt, fs, path::PathBuf, str::FromStr}; use crate::{dirs, err::ConfigErr}; -use clap::Clap; +use clap::Parser; use vfs::ReadOnlyVfs; -#[derive(Clap, Debug)] +#[derive(Parser, Debug)] #[clap(version, author, about)] pub struct Opts { #[clap(subcommand)] pub cmd: SubCommand, } -#[derive(Clap, Debug)] +#[derive(Parser, Debug)] pub enum SubCommand { /// Lints and suggestions for the nix programming language Check(Check), @@ -24,7 +24,7 @@ pub enum SubCommand { Explain(Explain), } -#[derive(Clap, Debug)] +#[derive(Parser, Debug)] pub struct Check { /// File or directory to run check on #[clap(default_value = ".", parse(from_os_str))] @@ -67,7 +67,7 @@ impl Check { } } -#[derive(Clap, Debug)] +#[derive(Parser, Debug)] pub struct Fix { /// File or directory to run fix on #[clap(default_value = ".", parse(from_os_str))] @@ -127,7 +127,7 @@ impl Fix { } } -#[derive(Clap, Debug)] +#[derive(Parser, Debug)] pub struct Single { /// File to run single-fix on #[clap(parse(from_os_str))] @@ -174,7 +174,7 @@ impl Single { } } -#[derive(Clap, Debug)] +#[derive(Parser, Debug)] pub struct Explain { /// Warning code to explain #[clap(parse(try_from_str = parse_warning_code))] diff --git a/bin/src/lib.rs b/bin/src/lib.rs new file mode 100644 index 0000000..49c1a41 --- /dev/null +++ b/bin/src/lib.rs @@ -0,0 +1,7 @@ +pub mod config; +pub mod dirs; +pub mod err; +pub mod explain; +pub mod fix; +pub mod lint; +pub mod traits; diff --git a/bin/src/main.rs b/bin/src/main.rs index fabc509..f504796 100644 --- a/bin/src/main.rs +++ b/bin/src/main.rs @@ -1,15 +1,9 @@ -mod config; -mod dirs; -mod err; -mod explain; -mod fix; -mod lint; -mod traits; - -use crate::err::StatixErr; - -use clap::Clap; -use config::{Opts, SubCommand}; +use clap::Parser; +use statix::{ + config::{Opts, SubCommand}, + err::StatixErr, + explain, fix, lint, +}; fn _main() -> Result<(), StatixErr> { let opts = Opts::parse(); -- cgit v1.2.3