Skip to content

Commit 7ce293a

Browse files
committed
Add --no-hint to vhdl lang to skips hints when we only care about errors in for example UVVM
1 parent 9657798 commit 7ce293a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

vhdl_lang/src/main.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use clap::Parser;
1313
use std::path::Path;
1414
use std::time::SystemTime;
15-
use vhdl_lang::{Config, Diagnostic, MessagePrinter, NullMessages, Project};
15+
use vhdl_lang::{Config, Diagnostic, MessagePrinter, NullMessages, Project, Severity};
1616

1717
/// Run vhdl analysis
1818
#[derive(Parser, Debug)]
@@ -30,6 +30,10 @@ struct Args {
3030
#[arg(long, default_value_t = false)]
3131
bench: bool,
3232

33+
/// Hide hint diagnostics
34+
#[arg(long, default_value_t = false)]
35+
no_hint: bool,
36+
3337
/// Config file in TOML format containing libraries and settings
3438
#[arg(short, long)]
3539
config: String,
@@ -75,8 +79,13 @@ fn main() {
7579
};
7680

7781
let mut project = Project::from_config(&config, &mut msg_printer);
78-
let diagnostics = project.analyse();
82+
let mut diagnostics = project.analyse();
7983
let duration = start.elapsed().unwrap() / iterations;
84+
85+
if args.no_hint {
86+
diagnostics.retain(|diag| diag.severity != Severity::Hint);
87+
}
88+
8089
show_diagnostics(&diagnostics);
8190

8291
if args.perf || args.bench {

0 commit comments

Comments
 (0)