@@ -174,7 +174,7 @@ package body Gnatcheck.Diagnoses is
174174 -- boolean parameter is used to define the needed indentation level
175175
176176 function Strip_Tag (Diag : String) return String;
177- -- Strip trailing " [-gnatxxx ]", if any
177+ -- Strip trailing GNAT tag following the format " [-gnat<x> ]", if any
178178
179179 -- --------------------------------------------------------------------
180180 -- Data structures and local routines for rule exemption mechanism --
@@ -1682,11 +1682,11 @@ package body Gnatcheck.Diagnoses is
16821682
16831683 function Preprocess_Diag (Diag : String) return String;
16841684 -- Add GPS_Prefix if Progress_Indicator_Mode is True, and remove any
1685- -- training [-gnatwxxx] .
1685+ -- trailing GNAT tag following the "[-gnat<x>]" format .
16861686
16871687 procedure Counted_Print_Diagnosis
16881688 (Position : Error_Messages_Storage.Cursor);
1689- -- Print Diagnosis until reaching Max_Diagnoses
1689+ -- Print diagnosis until reaching Max_Diagnoses
16901690
16911691 -- -------------------
16921692 -- Preprocess_Diag --
@@ -3029,8 +3029,19 @@ package body Gnatcheck.Diagnoses is
30293029 (Ada.Strings.Fixed.Trim (Line_Number'Image (Sloc.Line), Left)
30303030 & ' :' & Column_Str);
30313031 end Image ;
3032+
3033+ Tag_String : constant String :=
3034+ (case Self.Diagnosis_Kind is
3035+ when Rule_Violation =>
3036+ (if Self.Justification /= Null_Unbounded_String
3037+ then " rule violation (exempted): "
3038+ else " rule violation: " ),
3039+ when Exemption_Warning => " warning: " ,
3040+ when others => " " );
30323041 begin
3033- return To_String (Self.File) & " :" & Image (Self.Sloc) & " : "
3042+ return To_String (Self.File) & " :"
3043+ & Image (Self.Sloc) & " : "
3044+ & Tag_String
30343045 & To_String (Self.Text);
30353046 end Image ;
30363047
0 commit comments