-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
surface
forge fmt
errors, clean up and colorize terminal output (#4)
* fix: show warnings/errors from forge fmt * style: better looking log outputs * build: bump version * chore: small cleanup * Added helpful error message (#6) Signed-off-by: Matt Solomon <[email protected]> Signed-off-by: Matt Solomon <[email protected]> Signed-off-by: Matt Solomon <[email protected]> Co-authored-by: John Feras <[email protected]>
- Loading branch information
Showing
5 changed files
with
48 additions
and
20 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
#![doc = include_str!("../README.md")] | ||
#![warn(missing_docs, unreachable_pub, unused, rust_2021_compatibility)] | ||
#![warn(clippy::all, clippy::pedantic, clippy::cargo, clippy::nursery)] | ||
use colored::Colorize; | ||
use std::{env, process}; | ||
|
||
fn main() { | ||
let args: Vec<String> = env::args().collect(); | ||
|
||
let config = scopelint::Config::build(&args).unwrap_or_else(|err| { | ||
eprintln!("Problem parsing arguments: {err}"); | ||
eprintln!("{}: Argument parsing failed with '{err}'", "error".bold().red()); | ||
process::exit(1); | ||
}); | ||
|
||
if let Err(err) = scopelint::run(&config) { | ||
eprintln!("\nExecution failed: {err}"); | ||
if let Err(_err) = scopelint::run(&config) { | ||
// All warnings/errors have already been logged. | ||
process::exit(1); | ||
} | ||
} |