Skip to content

Commit

Permalink
Merge branch 'topic/doc_final_pkg_rule' into 'master'
Browse files Browse the repository at this point in the history
Add documentation for final packages rule

Closes #170

See merge request eng/libadalang/langkit-query-language!209
  • Loading branch information
raph-amiard committed Apr 30, 2024
2 parents dcd95bf + 28d1f41 commit 1a64082
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions lkql_checker/doc/gnatcheck_rm/list_of_rules.rst
Expand Up @@ -61,6 +61,7 @@ GNATcheck rules.
* :ref:`Explicit_Full_Discrete_Ranges`
* :ref:`Explicit_Inlining`
* :ref:`Expression_Functions`
* :ref:`Final_Package`
* :ref:`Fixed_Equality_Checks`
* :ref:`Float_Equality_Checks`
* :ref:`Forbidden_Aspects`
Expand Down
25 changes: 25 additions & 0 deletions lkql_checker/doc/gnatcheck_rm/predefined_rules.rst
Expand Up @@ -2651,6 +2651,31 @@ This rule has the following (optional) parameter for the ``+R`` option:
end Bar;
.. _Final_Package:

``Final_Package``
^^^^^^^^^^^^^^^^^

Check that package declarations annotated as final don't have child
packages

.. note:: We don't do a transitive check, so grandchild packages won't
be flagged. We consider this is not necessary, because the child
package will be flagged anyway.

Here is an example:

.. code-block:: ada
package Pkg with Annotate => (GNATcheck, Final) is
end Pkg;
package Pkg.Child is -- FLAG
end Pkg.Child;
package Pkg.Child.Grandchild is -- NOFLAG
end Pkg.Child.Grandchild;
.. _Global_Variables:

``Global_Variables``
Expand Down

0 comments on commit 1a64082

Please sign in to comment.