Skip to content

Commit

Permalink
Merge branch 'mr/issue_272' into 'master'
Browse files Browse the repository at this point in the history
Use GNATformat edge

Closes #272

See merge request eng/ide/libadalang-tools!318
  • Loading branch information
joaopsazevedo committed Feb 25, 2025
2 parents 96cf83c + 72574cf commit cae0783
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ include:
stage: check
anod-spec: libadalang-tools
gnatformat-args: -P src/build.gpr --check
install-gnatformat: true
install-gnatformat-extra-anod-args: -Qedge

# Build
- component: $CI_SERVER_FQDN/eng/gitlab-templates/build@~latest
Expand Down
4 changes: 2 additions & 2 deletions src/metrics-actions.adb
Original file line number Diff line number Diff line change
Expand Up @@ -2675,7 +2675,7 @@ package body METRICS.Actions is
Assert
(Global_M.Vals (Complexity_Cyclomatic)
= Global_M.Vals (Complexity_Statement)
+ Global_M.Vals (Complexity_Expression));
+ Global_M.Vals (Complexity_Expression));

-- We're done with Metrix_Stack at this point. Printing uses the tree
-- formed by Submetrix.
Expand Down Expand Up @@ -4623,7 +4623,7 @@ package body METRICS.Actions is
Assert
(File_M.Vals (Complexity_Cyclomatic)
= File_M.Vals (Complexity_Statement)
+ File_M.Vals (Complexity_Expression));
+ File_M.Vals (Complexity_Expression));

if Debug_Flag_V then
Outdent;
Expand Down
19 changes: 9 additions & 10 deletions src/pp-actions.adb
Original file line number Diff line number Diff line change
Expand Up @@ -2726,12 +2726,12 @@ package body Pp.Actions is
(if Id (1) = ''' then As_Declared
elsif Id (1)
= '"' -- operator symbol
-- Kind not in Ada_Attribute_Ref | Ada_Update_Attribute_Ref
-- and then
-- (Id (1) = '"') -- operator symbol
-- or else Is_Reserved_Word (Id, Utils.Ada_Version)
-- or else Id = Name_And_Then
-- or else Id = Name_Or_Else)
-- Kind not in Ada_Attribute_Ref | Ada_Update_Attribute_Ref
-- and then
-- (Id (1) = '"') -- operator symbol
-- or else Is_Reserved_Word (Id, Utils.Ada_Version)
-- or else Id = Name_And_Then
-- or else Id = Name_Or_Else)
then PP_Keyword_Casing (Cmd)
elsif Is_Predef and then Use_Predefined_Casing then As_Declared
else
Expand Down Expand Up @@ -3812,10 +3812,9 @@ package body Pp.Actions is

if Inst_Index < TT.Instructions'Last
and then TT.Instructions (Inst_Index + 1)
=
(Kind => Verbatim,
T_Kind => Spaces,
Text => Name_Space)
= (Kind => Verbatim,
T_Kind => Spaces,
Text => Name_Space)
then
Inst_Index := Inst_Index + 1;
end if;
Expand Down
8 changes: 4 additions & 4 deletions src/pp-formatting.adb
Original file line number Diff line number Diff line change
Expand Up @@ -2327,7 +2327,7 @@ package body Pp.Formatting is
(All_LB,
All_LBI (F),
All_LBI (Next_Enabled (Lines_Data, F)))
+ Offset);
+ Offset);
F := L;
end loop; -- through line breaks

Expand Down Expand Up @@ -2637,7 +2637,7 @@ package body Pp.Formatting is
elsif Kind (Src_Tok) = '('
and then Kind (Prev_Lexeme (Src_Tok))
= '('
--???Also check that the one before that is a tick!
--???Also check that the one before that is a tick!
then
Qual_Nesting := Qual_Nesting + 1;
Next_ss (Src_Tok);
Expand Down Expand Up @@ -4552,8 +4552,8 @@ package body Pp.Formatting is

elsif LB.Indentation
/= L_Paren_Indent_For_Preserve
+ Before_Indentation
+ 1
+ Before_Indentation
+ 1
then
LB.Indentation :=
L_Paren_Indent_For_Preserve
Expand Down
2 changes: 1 addition & 1 deletion src/test-actions.adb
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ package body Test.Actions is
(Dir.Display_Full_Name,
Resolve_Links => False,
Case_Sensitive => False)
& Directory_Separator
& Directory_Separator
then
Cmd_Error_No_Help
("invalid harness directory, cannot mix up "
Expand Down
8 changes: 4 additions & 4 deletions src/test-skeleton.adb
Original file line number Diff line number Diff line change
Expand Up @@ -1584,8 +1584,8 @@ package body Test.Skeleton is

if Owner_Decl
/= No_Base_Type_Decl
-- If owner is incomplete private declaration (without "tagged"
-- keyword) subp should be treated as non-dispatching.
-- If owner is incomplete private declaration (without "tagged"
-- keyword) subp should be treated as non-dispatching.
then
if Owner_Decl.As_Base_Type_Decl.P_Is_Private then
Owner_Decl := Owner_Decl.As_Base_Type_Decl.P_Private_Completion;
Expand Down Expand Up @@ -8599,8 +8599,8 @@ package body Test.Skeleton is
if MD.Short_Name_Used
and then MD.Short_Name.all
= Short_Name
-- It is hard to understand what happens when test case
-- name is changed, so we do not handle this scenario.
-- It is hard to understand what happens when test case
-- name is changed, so we do not handle this scenario.
and then Markered_Data_Maps.Key (Cur).TC_Hash.all = TC_Hash
then
exit;
Expand Down

0 comments on commit cae0783

Please sign in to comment.