Skip to content

Commit d9b5a09

Browse files
committed
Merge branch 'mr/thevenoux-gnatcheck#1' into 'master'
Rename gnatcheck package to lkql_checker Closes eng/codepeer/gnatcheck#1 See merge request eng/libadalang/langkit-query-language!572
2 parents 18aa345 + b14ead2 commit d9b5a09

28 files changed

+291
-284
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ impacts:
4444
[ -f "$(KP_JSON)" ] || "$(PYTHON)" "./utils/impact-db_impacts_gen.py"
4545

4646
format:
47-
gnatformat -P lkql_checker/gnatcheck.gpr --no-subprojects
47+
gnatformat -P lkql_checker/lkql_checker.gpr --no-subprojects
4848
$(MAVEN) -f lkql_jit spotless:apply $(MAVEN_ARGS)
4949

5050
gnatcheck: lkql impacts
51-
gprbuild -P lkql_checker/gnatcheck.gpr -p $(GPR_ARGS) -XBUILD_MODE=$(BUILD_MODE)
51+
gprbuild -P lkql_checker/lkql_checker.gpr -p $(GPR_ARGS) -XBUILD_MODE=$(BUILD_MODE)
5252

5353
build/bin/liblkqllang_parse: lkql/lkql.lkt
5454
$(LKM) make -c lkql/langkit.yaml \
@@ -87,8 +87,8 @@ automated:
8787
rm -rf "$(PREFIX)"
8888
mkdir -p "$(PREFIX)/share" "$(PREFIX)/share/examples" "$(PREFIX)/lib"
8989
$(LKM) make -c lkql/langkit.yaml $(MANAGE_ARGS) $(ADDITIONAL_MANAGE_ARGS)
90-
$(GPRBUILD) -Plkql_checker/gnatcheck.gpr -largs -s
91-
$(GPRINSTALL) --mode=usage -Plkql_checker/gnatcheck.gpr
90+
$(GPRBUILD) -Plkql_checker/lkql_checker.gpr -largs -s
91+
$(GPRINSTALL) --mode=usage -Plkql_checker/lkql_checker.gpr
9292
$(GPRINSTALL) --mode=usage -P$(LKQL_DIR)/mains.gpr
9393
cp -pr lkql_checker/share/lkql "$(PREFIX)/share"
9494
cp -pr lkql_checker/share/examples "$(PREFIX)/share/examples/gnatcheck"

lkql_checker/doc/share/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252

5353

5454
def get_version():
55-
for line in open("../../src/gnatcheck-options.ads").readlines():
56-
if line.lstrip().startswith('Gnatcheck_Version'):
55+
for line in open("../../src/lkql_checker-options.ads").readlines():
56+
if line.lstrip().startswith('Lkql_Checker_Version'):
5757
return line[line.find('"') + 1:line.rfind('"')]
5858
raise Exception("Could not find the current version of GNATcheck")
5959

lkql_checker/gnatcheck.gpr renamed to lkql_checker/lkql_checker.gpr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ with "libadalang";
22
with "liblkqllang";
33
with "gpr2";
44

5-
project GNATcheck is
5+
project LKQL_Checker is
66
type Build_Mode_Type is ("dev", "prod");
77
Build_Mode : Build_Mode_Type := external
88
("BUILD_MODE", external ("LKQL_CHECKER_BUILD_MODE", "dev"));
99

1010
for Source_Dirs use ("src");
1111
for Object_Dir use "obj/" & Build_Mode;
1212
for Exec_Dir use "bin";
13-
for Main use ("gnatcheck_main.adb");
13+
for Main use ("main.adb");
1414

1515
package Binder is
1616
case Build_Mode is
@@ -22,7 +22,7 @@ project GNATcheck is
2222
end Binder;
2323

2424
package Builder is
25-
for Executable ("gnatcheck_main.adb") use "gnatcheck";
25+
for Executable ("main.adb") use "gnatcheck";
2626
for Switches ("Ada") use ("-j0");
2727
end Builder;
2828

@@ -43,4 +43,4 @@ project GNATcheck is
4343
for Charset ("Ada") use "utf-8";
4444
for Width ("Ada") use "79";
4545
end Format;
46-
end GNATcheck;
46+
end LKQL_Checker;

lkql_checker/src/gnatcheck-compiler.adb renamed to lkql_checker/src/lkql_checker-compiler.adb

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@ with GNAT.Regpat; use GNAT.Regpat;
1515
with GNAT.Strings;
1616
with GNAT.String_Split;
1717

18-
with Gnatcheck.Diagnoses; use Gnatcheck.Diagnoses;
19-
with Gnatcheck.Ids; use Gnatcheck.Ids;
20-
with Gnatcheck.Options; use Gnatcheck.Options;
21-
with Gnatcheck.Output; use Gnatcheck.Output;
22-
with Gnatcheck.Projects; use Gnatcheck.Projects;
23-
with Gnatcheck.Projects.Aggregate; use Gnatcheck.Projects.Aggregate;
24-
with Gnatcheck.Rules.Rule_Table; use Gnatcheck.Rules.Rule_Table;
25-
with Gnatcheck.Source_Table; use Gnatcheck.Source_Table;
26-
with Gnatcheck.String_Utilities; use Gnatcheck.String_Utilities;
18+
with Lkql_Checker.Diagnoses; use Lkql_Checker.Diagnoses;
19+
with Lkql_Checker.Ids; use Lkql_Checker.Ids;
20+
with Lkql_Checker.Options; use Lkql_Checker.Options;
21+
with Lkql_Checker.Output; use Lkql_Checker.Output;
22+
with Lkql_Checker.Projects; use Lkql_Checker.Projects;
23+
with Lkql_Checker.Projects.Aggregate; use Lkql_Checker.Projects.Aggregate;
24+
with Lkql_Checker.Rules.Rule_Table; use Lkql_Checker.Rules.Rule_Table;
25+
with Lkql_Checker.Source_Table; use Lkql_Checker.Source_Table;
26+
with Lkql_Checker.String_Utilities; use Lkql_Checker.String_Utilities;
2727

2828
with GNATCOLL.JSON; use GNATCOLL.JSON;
2929
with GNATCOLL.VFS; use GNATCOLL.VFS;
3030

3131
with Langkit_Support.Slocs; use Langkit_Support.Slocs;
3232

33-
package body Gnatcheck.Compiler is
33+
package body Lkql_Checker.Compiler is
3434

3535
use Rident;
3636

@@ -60,7 +60,7 @@ package body Gnatcheck.Compiler is
6060
-- * Remove warning and style markers for Warning, Style, Restriction
6161
-- messages.
6262
--
63-
-- * If Gnatcheck.Options.Mapping_Mode is ON, annotates the message by
63+
-- * If Lkql_Checker.Options.Mapping_Mode is ON, annotates the message by
6464
-- adding the compiler check (if for a warning message '.d' is specified,
6565
-- the trailing part that indicates the warning message that causes this
6666
-- warning is removed from the diagnosis, and the corresponding warning
@@ -70,7 +70,7 @@ package body Gnatcheck.Compiler is
7070
function Annotation
7171
(Message_Kind : Message_Kinds; Parameter : String) return String;
7272
-- Returns annotation to be added to the compiler diagnostic message if
73-
-- Gnatcheck.Options.Mapping_Mode is ON. Parameter, if non-empty, is the
73+
-- Lkql_Checker.Options.Mapping_Mode is ON. Parameter, if non-empty, is the
7474
-- parameter of '-gnatw/y' option that causes the diagnosis
7575

7676
function Get_Rule_Id (Check : Message_Kinds) return Rule_Id;
@@ -263,7 +263,7 @@ package body Gnatcheck.Compiler is
263263
Sep_Idx : Natural := 0;
264264

265265
begin
266-
Last_Idx := Path_Index (Result, Gnatcheck_Config_File.all);
266+
Last_Idx := Path_Index (Result, Checker_Config_File.all);
267267

268268
if Last_Idx = 0 then
269269
Last_Idx := Result'Last;
@@ -460,7 +460,7 @@ package body Gnatcheck.Compiler is
460460
then To_Lower (Rule_Name)
461461
else To_Lower (Instance_Name));
462462
Store_Diagnosis
463-
(Full_File_Name => Gnatcheck.Source_Table.File_Name (SF),
463+
(Full_File_Name => Lkql_Checker.Source_Table.File_Name (SF),
464464
Message =>
465465
Msg (Msg_Start + 7 .. Last - 2) & Instance.Annotate_Diag,
466466
Sloc => Sloc,
@@ -496,7 +496,7 @@ package body Gnatcheck.Compiler is
496496
Message_Kind := Restriction;
497497
elsif Msg (Msg_Start + 9 .. Msg_Start + 19) = "cannot find" then
498498
Report_Missing_File
499-
(Gnatcheck.Source_Table.File_Name (SF),
499+
(Lkql_Checker.Source_Table.File_Name (SF),
500500
Msg (Msg_Start + 21 .. Msg_End));
501501
return;
502502
else
@@ -514,15 +514,15 @@ package body Gnatcheck.Compiler is
514514

515515
-- Skip restriction message not coming from the GNATcheck config file
516516
if Message_Kind = Restriction
517-
and then Path_Index (Msg, Gnatcheck_Config_File.all) = 0
517+
and then Path_Index (Msg, Checker_Config_File.all) = 0
518518
then
519519
return;
520520
end if;
521521

522522
-- Use File_Name to always use the same filename (including proper
523523
-- casing for case insensitive systems).
524524
Store_Diagnosis
525-
(Full_File_Name => Gnatcheck.Source_Table.File_Name (SF),
525+
(Full_File_Name => Lkql_Checker.Source_Table.File_Name (SF),
526526
Sloc => Sloc,
527527
Message =>
528528
Adjust_Message (Msg (Msg_Start .. Msg_End), Message_Kind),
@@ -804,7 +804,7 @@ package body Gnatcheck.Compiler is
804804

805805
declare
806806
Config_File : constant Virtual_File :=
807-
Create (+Gnatcheck_Config_File.all);
807+
Create (+Checker_Config_File.all);
808808
File : Writable_File;
809809
Old_Contents : GNAT.Strings.String_Access;
810810
New_Contents : constant String := To_String (Contents);
@@ -1717,11 +1717,11 @@ package body Gnatcheck.Compiler is
17171717
end if;
17181718
end Set_Compiler_Checks;
17191719

1720-
----------------------------
1721-
-- Spawn_Gnatcheck_Worker --
1722-
----------------------------
1720+
--------------------------
1721+
-- Spawn_Checker_Worker --
1722+
--------------------------
17231723

1724-
function Spawn_Gnatcheck_Worker
1724+
function Spawn_Checker_Worker
17251725
(Rule_File : String;
17261726
Msg_File : String;
17271727
Source_File : String;
@@ -1732,8 +1732,8 @@ package body Gnatcheck.Compiler is
17321732
Pid : Process_Id;
17331733
Split_Command : constant Slice_Set := Create (Worker_Name, " ");
17341734
Worker : String_Access := null;
1735-
Prj : constant String := Gnatcheck_Prj.Source_Prj;
1736-
CGPR : constant String := Gnatcheck_Prj.Source_CGPR;
1735+
Prj : constant String := Checker_Prj.Source_Prj;
1736+
CGPR : constant String := Checker_Prj.Source_CGPR;
17371737
Args : Argument_List (1 .. 128);
17381738
Num_Args : Integer := 0;
17391739

@@ -1773,15 +1773,15 @@ package body Gnatcheck.Compiler is
17731773
Num_Args := @ + 1;
17741774
Args (Num_Args) := new String'("--ignore-project-switches");
17751775
end if;
1776-
elsif Gnatcheck_Prj.Tree.Is_Defined
1777-
and then Gnatcheck_Prj.Tree.Root_Project.Path_Name.Exists
1776+
elsif Checker_Prj.Tree.Is_Defined
1777+
and then Checker_Prj.Tree.Root_Project.Path_Name.Exists
17781778
then
17791779
-- In case Prj has not been explicitly set, spawn the project option
17801780
-- with the default project file used by gpr.
17811781
Num_Args := @ + 1;
17821782
Args (Num_Args) :=
17831783
new String'
1784-
("-P" & Gnatcheck_Prj.Tree.Root_Project.Path_Name.String_Value);
1784+
("-P" & Checker_Prj.Tree.Root_Project.Path_Name.String_Value);
17851785
end if;
17861786

17871787
if Arg.Aggregated_Project then
@@ -1855,7 +1855,7 @@ package body Gnatcheck.Compiler is
18551855
end loop;
18561856

18571857
return Pid;
1858-
end Spawn_Gnatcheck_Worker;
1858+
end Spawn_Checker_Worker;
18591859

18601860
-----------------------------------
18611861
-- Spawn_LKQL_Rule_Config_Parser --
@@ -1927,7 +1927,7 @@ package body Gnatcheck.Compiler is
19271927

19281928
Pid : Process_Id;
19291929
GPRbuild : String_Access := Locate_Exec_On_Path (GPRbuild_Exec);
1930-
Prj : constant String := Gnatcheck_Prj.Source_Prj;
1930+
Prj : constant String := Checker_Prj.Source_Prj;
19311931
Last_Source : constant SF_Id := Last_Argument_Source;
19321932
Args : Argument_List (1 .. 128 + Integer (Last_Source));
19331933
Num_Args : Integer := 0;
@@ -2003,7 +2003,7 @@ package body Gnatcheck.Compiler is
20032003
end loop;
20042004

20052005
if Analyze_Compiler_Output then
2006-
Add_Arg ("-gnatec=" & Gnatcheck_Config_File.all);
2006+
Add_Arg ("-gnatec=" & Checker_Config_File.all);
20072007
Add_Arg ("-gnatcU");
20082008
Add_Arg ("-gnatwnA.d");
20092009

@@ -2172,4 +2172,4 @@ package body Gnatcheck.Compiler is
21722172
XML_Report ("</rule>", Indent_Level);
21732173
end XML_Print_Active_Restrictions;
21742174

2175-
end Gnatcheck.Compiler;
2175+
end Lkql_Checker.Compiler;

lkql_checker/src/gnatcheck-compiler.ads renamed to lkql_checker/src/lkql_checker-compiler.ads

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ with Ada.Text_IO; use Ada.Text_IO;
1010

1111
with GNAT.OS_Lib; use GNAT.OS_Lib;
1212

13-
with Gnatcheck.Rules; use Gnatcheck.Rules;
13+
with Lkql_Checker.Rules; use Lkql_Checker.Rules;
1414

15-
package Gnatcheck.Compiler is
15+
package Lkql_Checker.Compiler is
1616

1717
---------------------
1818
-- Runtime helpers --
@@ -63,10 +63,10 @@ package Gnatcheck.Compiler is
6363
-- Boolean flag indicating if gnatcheck should spawn the compiler and
6464
-- analyze its output.
6565

66-
Gnatcheck_Config_File : String_Access :=
66+
Checker_Config_File : String_Access :=
6767
new String'("restriction_pragmas.adc");
68-
-- The name of the file to place configuration pragmas gnatcheck needs to
69-
-- add the compiler checks to its report. This file always starts with:
68+
-- The name of the file to place configuration pragmas that we need to add
69+
-- the compiler checks to its report. This file always starts with:
7070
--
7171
-- pragma Warnings (Off, "[enabled by default]");
7272
--
@@ -155,16 +155,15 @@ package Gnatcheck.Compiler is
155155
-- format of restriction rules and places the output into the specified
156156
-- file that is supposed to be an opened out file.
157157

158-
function Spawn_Gnatcheck_Worker
158+
function Spawn_Checker_Worker
159159
(Rule_File : String;
160160
Msg_File : String;
161161
Source_File : String;
162162
Log_File : String) return Process_Id;
163-
-- Spawn a gnatcheck worker (LKQL) on the main project file with the
164-
-- relevant options on the rules given by Rule_File, redirecting the
165-
-- output to Msg_File. Source_File is the name of a file listing all the
166-
-- source files to analyze. Log_File is the name of a file used to store
167-
-- worker's logs.
163+
-- Spawn a worker (LKQL) on the main project file with the relevant options
164+
-- on the rules given by Rule_File, redirecting the output to Msg_File.
165+
-- Source_File is the name of a file listing all the source files to
166+
-- analyze. Log_File is the name of a file used to store worker's logs.
168167

169168
function Spawn_LKQL_Rule_File_Parser
170169
(LKQL_RF_Name : String; Result_File : String) return Process_Id;
@@ -228,4 +227,4 @@ package Gnatcheck.Compiler is
228227
-- some warning-based rule, returns the parameter of the rule (used
229228
-- in parametrized exemption sections for warnings).
230229

231-
end Gnatcheck.Compiler;
230+
end Lkql_Checker.Compiler;

0 commit comments

Comments
 (0)