Skip to content

Commit 0d669aa

Browse files
committed
Merge branch 'topic/gnatcheck/implicit_rule_file' into 'master'
Disable implicit LKQL rule file fetching from the working directory Closes #457 See merge request eng/libadalang/langkit-query-language!428
2 parents 1d18b92 + a74ce69 commit 0d669aa

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

lkql_checker/doc/gnatcheck_rm/using_gnatcheck.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -442,11 +442,11 @@ You can configure GNATcheck rules using an LKQL file, provided through the
442442
``--rule-file`` command-line option or implicitly fetched by GNATcheck (as
443443
described in the following paragraph).
444444

445-
By default, GNATcheck will look for a ``rules.lkql`` file in the current working
446-
directory or besides the specified project file if any. If there is one and
447-
no other rule configuration has been provided (through an LKQL rule file, or
448-
through the rule options), GNATcheck will load it as the LKQL rule options
449-
file, as if it was provided through the ``--rule-file`` option.
445+
By default, GNATcheck will look for a ``rules.lkql`` file besides the specified
446+
project file if any. If there is one and no other rule configuration has been
447+
provided (through an LKQL rule file, or through the rule options), GNATcheck
448+
will load it as the LKQL rule options file, as if it was provided through the
449+
``--rule-file`` option.
450450

451451
.. note::
452452

lkql_checker/src/gnatcheck_main.adb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ begin
511511
end if;
512512

513513
-- Get the default LKQL rule file if none has been specified
514-
if Is_Rule_Options_Empty then
514+
if Is_Rule_Options_Empty and then Gnatcheck_Prj.Is_Specified then
515515
declare
516516
Def_LKQL : constant String := Default_LKQL_Rule_Options_File;
517517
begin

testsuite/tests/gnatcheck/lkql_rules_config/implicit_config_file/test.out

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
Without project file
22
====================
33

4-
main.adb:3:04: rule violation: goto statement
4+
gnatcheck: error: no rule to check specified
5+
try "gnatcheck --help" for more information.
6+
>>>program returned status code 2
57

68
With project file
79
=================

0 commit comments

Comments
 (0)