Skip to content

Commit 1a64082

Browse files
committed
Merge branch 'topic/doc_final_pkg_rule' into 'master'
Add documentation for final packages rule Closes #170 See merge request eng/libadalang/langkit-query-language!209
2 parents dcd95bf + 28d1f41 commit 1a64082

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

lkql_checker/doc/gnatcheck_rm/list_of_rules.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ GNATcheck rules.
6161
* :ref:`Explicit_Full_Discrete_Ranges`
6262
* :ref:`Explicit_Inlining`
6363
* :ref:`Expression_Functions`
64+
* :ref:`Final_Package`
6465
* :ref:`Fixed_Equality_Checks`
6566
* :ref:`Float_Equality_Checks`
6667
* :ref:`Forbidden_Aspects`

lkql_checker/doc/gnatcheck_rm/predefined_rules.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2651,6 +2651,31 @@ This rule has the following (optional) parameter for the ``+R`` option:
26512651
end Bar;
26522652
26532653
2654+
.. _Final_Package:
2655+
2656+
``Final_Package``
2657+
^^^^^^^^^^^^^^^^^
2658+
2659+
Check that package declarations annotated as final don't have child
2660+
packages
2661+
2662+
.. note:: We don't do a transitive check, so grandchild packages won't
2663+
be flagged. We consider this is not necessary, because the child
2664+
package will be flagged anyway.
2665+
2666+
Here is an example:
2667+
2668+
.. code-block:: ada
2669+
2670+
package Pkg with Annotate => (GNATcheck, Final) is
2671+
end Pkg;
2672+
2673+
package Pkg.Child is -- FLAG
2674+
end Pkg.Child;
2675+
2676+
package Pkg.Child.Grandchild is -- NOFLAG
2677+
end Pkg.Child.Grandchild;
2678+
26542679
.. _Global_Variables:
26552680

26562681
``Global_Variables``

0 commit comments

Comments
 (0)