From 277a6a020a88a855ffcb90a26067645f99e3b60e Mon Sep 17 00:00:00 2001 From: Alex Ford Date: Thu, 13 May 2021 13:37:32 +0100 Subject: [PATCH] diagnostics: use debug rather than hidden terminology, and leave gaps for other severities --- extractor/src/extractor.rs | 2 +- generator/src/main.rs | 8 ++++---- ql/src/codeql_ruby/Diagnostics.qll | 8 ++++---- ql/src/ruby.dbscheme | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/extractor/src/extractor.rs b/extractor/src/extractor.rs index 33d06358a2a..7c9e64a4f7d 100644 --- a/extractor/src/extractor.rs +++ b/extractor/src/extractor.rs @@ -281,7 +281,7 @@ impl Visitor<'_> { "diagnostics", vec![ Arg::Label(id), - Arg::Int(3), // severity 3 = error + Arg::Int(40), // severity 40 = error Arg::String("parse_error".to_string()), Arg::String(error_message), Arg::String(full_error_message), diff --git a/generator/src/main.rs b/generator/src/main.rs index c3561e8dc68..238e659209b 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -645,10 +645,10 @@ fn create_diagnostics<'a>() -> (dbscheme::Case<'a>, dbscheme::Table<'a>) { ], }; let severities: Vec<(usize, &str)> = vec![ - (0, "diagnostic_hidden"), - (1, "diagnostic_info"), - (2, "diagnostic_warning"), - (3, "diagnostic_error"), + (10, "diagnostic_debug"), + (20, "diagnostic_info"), + (30, "diagnostic_warning"), + (40, "diagnostic_error"), ]; let case = dbscheme::Case { name: "diagnostic", diff --git a/ql/src/codeql_ruby/Diagnostics.qll b/ql/src/codeql_ruby/Diagnostics.qll index d97030b57e7..b8995c01bc2 100644 --- a/ql/src/codeql_ruby/Diagnostics.qll +++ b/ql/src/codeql_ruby/Diagnostics.qll @@ -17,13 +17,13 @@ class Diagnostic extends @diagnostic { /** Gets a string representation of the severity of this diagnostic. */ string getSeverityText() { - severity = 0 and result = "Hidden" + severity = 10 and result = "Debug" or - severity = 1 and result = "Info" + severity = 20 and result = "Info" or - severity = 2 and result = "Warning" + severity = 30 and result = "Warning" or - severity = 3 and result = "Error" + severity = 40 and result = "Error" } /** Gets the error code associated with this diagnostic, e.g. parse_error. */ diff --git a/ql/src/ruby.dbscheme b/ql/src/ruby.dbscheme index e9164e21ebf..40be81bc208 100644 --- a/ql/src/ruby.dbscheme +++ b/ql/src/ruby.dbscheme @@ -1247,10 +1247,10 @@ diagnostics( ); case @diagnostic.severity of - 0 = @diagnostic_hidden -| 1 = @diagnostic_info -| 2 = @diagnostic_warning -| 3 = @diagnostic_error + 10 = @diagnostic_debug +| 20 = @diagnostic_info +| 30 = @diagnostic_warning +| 40 = @diagnostic_error ;