Skip to content

Commit

Permalink
Merge branch 'topic/fix_exemptions' into 'master'
Browse files Browse the repository at this point in the history
Fix the exemption post processing process

Closes #369

See merge request eng/libadalang/langkit-query-language!317
  • Loading branch information
HugoGGuerrier committed Nov 15, 2024
2 parents e2b95d5 + 65b5f84 commit 3ee4ec6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 1 addition & 3 deletions lkql_checker/src/gnatcheck-diagnoses.adb
Original file line number Diff line number Diff line change
Expand Up @@ -1219,9 +1219,7 @@ package body Gnatcheck.Diagnoses is
end if;

-- Traverse exemption section chain
while Section /= null
and then For_Line <= Section.Exemption_Section.Line_End
loop
while Section /= null loop
if For_Line in
Section.Exemption_Section.Line_Start ..
Section.Exemption_Section.Line_End
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,16 @@ procedure Main is
procedure Poo (A : Integer) is null; --## rule line off implicit_in ## justify line off -- FLAG in valid exemptions

-- Check that there is a warning for "rule line on"
procedure Poo (A : Integer) is null; --## rule line on implicit_in -- FLAG (2)
procedure Roo (A : Integer) is null; --## rule line on implicit_in -- FLAG (2)

-- Check that exempting with a comment after exempting with a pragma is working as expected
--## rule off implicit_in ## Because
procedure Zoo (A : Integer) is null; -- FLAG
--## rule on implicit_in

pragma Annotate (Gnatcheck, Exempt_On, "implicit_in", "Because");
procedure Woo (A : Integer) is null; -- FLAG
pragma Annotate (Gnatcheck, Exempt_Off, "implicit_in");
begin
null;
end Main;
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
non-exempted violations : 3
rule exemption warnings : 5
compilation errors : 0
exempted violations : 5
exempted violations : 7
internal errors : 0

2. Exempted Coding Standard Violations
Expand All @@ -25,6 +25,10 @@ main.adb:30:19: implicit IN mode in parameter specification
(justify line off -- FLAG in valid exemptions)
main.adb:33:19: implicit IN mode in parameter specification
(unjustified)
main.adb:37:19: implicit IN mode in parameter specification
(Because)
main.adb:41:19: implicit IN mode in parameter specification
(Because)

3. Non-exempted Coding Standard Violations

Expand Down

0 comments on commit 3ee4ec6

Please sign in to comment.