Skip to content

Commit

Permalink
Fix the 'nested_paths' rule
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoGGuerrier committed Dec 16, 2024
1 parent 44f8b40 commit 350ad5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lkql_checker/share/lkql/nested_paths.lkql
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fun nested_paths(node) =
if_stmt.f_alternatives[1] == null

# Has an "else" part
and if_stmt.f_else_part.f_stmts[1] != null
and if_stmt.f_else_part != null

and not has_last_breaking_stmt(node)
and has_last_breaking_stmt(if if_stmt.f_then_stmts == node
Expand Down
4 changes: 4 additions & 0 deletions testsuite/tests/checks/nested_paths/paths.adb
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,8 @@ begin
else
I := I + 1; -- NOFLAG
end if;

if Cond then
null; -- NOFLAG
end if;
end Paths;

0 comments on commit 350ad5d

Please sign in to comment.